Tree using Python
Hey guys hope you enjoyed this video and learn something new about turtle module then make sure to hit the like share and subscribe button and also share this video with your friend and family sol that they can also get to knew
If you want to see "Tree using python" video then click 'here'
Source Code
from turtle import *
import colorsys
hideturtle()
speed(0)
bgcolor('black')
pensize(5)
h=0.7
lt(90)
def tree(x):
global h
c=colorsys.hsv_to_rgb(h,1,1)
color(c)
h+=0.004
if(x<10):
return
else:
fd(x)
lt(30)
tree(3*x/4)
rt(60)
tree(3*x/4)
lt(30)
bk(x)
tree(70)
done()
Comments
Post a Comment