r/learnpython • • 9d ago

pythagoras tree

I made code for one "branch" of the Pythagoras tree, and I have no idea how to make the full tree. Can someone help? My code:

from turtle import*
x=100
while True:
    for i in range (4):
        fd(x)
        rt(90)
    rt(90)
    fd(x)
    lt(45)
    xNaDwa= x*x/2
    y= xNaDwa**0.5
    x=y
3 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/Financial_Farm4326 7d ago

pretty much the cleanest way to explain turtle recursion tbh