我想画5个海龟整数,但我正在逐渐上线25.这一个TypeError
是我的代码:类型错误:起点必须是
import turtle
wn = turtle.Screen()
redrose = turtle.Turtle()
color = input("What will your background color be?")
fillcolor_f = input("What will the color of your rose be?")
redrose.hideturtle()
redrose.speed(30)
redrose.penup()
redrose.left(180)
redrose.forward(175)
redrose.right(90)
redrose.forward(30)
redrose.right(90)
redrose.pendown()
def drawRose(red):
redrose.color("pink")
redrose.fillcolor(fillcolor_f)
redrose.fill(True)
for i in range(red):
redrose.forward(i)
redrose.right(49)
for i in range(5):
drawRose(redrose)
redrose.penup()
redrose.forward(350)
redrose.right(144)
redrose.pendown()
redrose.fill(False)
drawRose(50)
wn.bgcolor(color)
我想画五朵玫瑰花,但它产生错误。我在interactivepython.org上做了这个。
我不能做了解释,因为我是一个中间编码 –
你有一个被称为像这通常会导致问题的函数变量:颜色 – palsch