+ 1
What is the error in this code?? The error is in 8 line
from Turtle import * def draw_multicolor_square(t, sz): for i in ["red", "purple", "hotpink", "blue"]: t.color(i) t.forward(sz) t.left(90) wn = turtle.Screen() wn.bgcolor("lightgreen") tess = turtle.Turtle() tess.pensize(3) size = 20 for i in range(15): draw_multicolor_square(tess, size) size =size + 10 tess.forward(10) tess.right(18) wn.mainloop()
3 Answers
+ 1
It don't also work ... I did all the changes but it still don't work
+ 1
It tell me that no module is called 'turtle '
0
# Try this code, and your code output is very Beautiful
from turtle import *
def draw_multicolor_square(t, sz):
for i in ["red", "purple", "hotpink", "blue"]:
t.color(i)
t.forward(sz)
t.left(90)
wn = Screen()
wn.bgcolor("lightgreen")
tess = Turtle()
tess.pensize(3)
size = 20
for i in range(15):
draw_multicolor_square(tess, size)
size =size + 10
tess.forward(10)
tess.right(18)
wn.mainloop()