Commit e1cb2328 by BellCodeEditor

save project

parent 288907e6
Showing with 37 additions and 18 deletions
det func(n):
if n<2:
return 1
elif n>2:
value=func(n-1)+func(n-2)
return value
return=func(6)
print(result)
\ No newline at end of file
import turtle
def tree(n):
if n>=50:
pen.forward(n)
pen.right(30)
tree(50)
pen.up()
pen.backward(n)
pen.down()
pen=turtle.Turtle()
pen.color("sienna")
pen.speed(1)
w=turtle.Screen()
w.bgcolor("wheat")
pen.left(90)
pen.up()
pen.backward(150)
pen.down()
turtle.done()
\ No newline at end of file
def func(n):
if n<=2:
return 1
elif n>2:
value=func(n-1)+func(n-2)
return value
result = func(6)
print(result)
\ No newline at end of file
import turtle
pen=turtle.Turtle()
pen.color("sienna")
w=turtle.Screen()
w.bgcolor("wheat")
pen.left(90)
pen.up()
pen.backward(150)
pen.down()
pen.forward(100)
pen.right(30)
pen.forward(50)
turtle.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment