Commit 297c4d18 by BellCodeEditor

save project

parent d252f19a
Showing with 3 additions and 2 deletions
...@@ -13,6 +13,7 @@ pen.backward(150) # 后退 ...@@ -13,6 +13,7 @@ pen.backward(150) # 后退
pen.down() pen.down()
def tree(n): def tree(n):
if n >= 0:
if n <= 12: if n <= 12:
color_list = ['snow','lightcoral'] color_list = ['snow','lightcoral']
color = random.choice(color_list) color = random.choice(color_list)
...@@ -32,8 +33,8 @@ def tree(n): ...@@ -32,8 +33,8 @@ def tree(n):
pen.up() pen.up()
pen.backward(n) pen.backward(n)
pen.down() pen.down()
tree(100) tree(100)
turtle.done() turtle.done()
......
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