python - TypeError: start must be a integer -
i trying draw 5 turtles, getting typeerror
on line 25. here code:
import turtle wn = turtle.screen() redrose = turtle.turtle() color = input("what background color be?") fillcolor_f = input("what color of 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) in range(red): redrose.forward(i) redrose.right(49) in range(5): drawrose(redrose) redrose.penup() redrose.forward(350) redrose.right(144) redrose.pendown() redrose.fill(false) drawrose(50) wn.bgcolor(color)
i trying draw 5 roses, produces errors. doing in interactivepython.org.
you recursively calling drawrose
wrong parameter. on line 23 (for in range(red):
) expect red
integer, it, when first called on line 36 (drawrose(50)
). on line 27 (drawrose(redrose)
) passing in redrose
object, turtle. not clear me should pass in there. doubt want call recursively. suspect want function drawpetal
.
Comments
Post a Comment