Commit 517411ed by BellCodeEditor

save project

parent fde3f90a
Showing with 3 additions and 3 deletions
import turtle
value = input('请输入珊瑚的长度,至少为大于100的整十数:')
value = input('请输入珊瑚的长度,至少为大于100小于200的整十数:')
pen = turtle.Turtle()
pen.color('sienna') # sienna黄土色
# 画布大小
......@@ -13,7 +13,7 @@ pen.backward(150) # 后退
pen.down()
def tree(n):
if n>=50:
if 200>=n>=50:
pen.forward(n)
pen.right(30)
tree(n-10)
......@@ -23,7 +23,7 @@ def tree(n):
pen.up()
pen.backward(n)
pen.down()
tree(value)
tree(int(value))
pen.hideturtle()
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