0

help indentation error in colors = ["deeppink", "gold", "cyan", "orange"]

from turtle import * #choose colors : colors = ["deeppink", "gold", "cyan", "orange"] bgcolor ("black") r=[350,350] s=1,4 turtles = [Turtle( ), Turtle( )] for index,i in enumerate(turtles) : i.speed(0) i.color("white") i.shape("circle") i.shaoesize(0.3) i.width(3) i.pu() i.seth(90) i.fd(r[index]) i.seth(180) i.pd() turtles[0].pu() tracer(30) speed(0) ht() for i in colors: color(i) for i in range(360//min(s)): for i in range(s[0]) : turtles[0].fd(1.75*r[0]/100) turtles[0].lt(1) pu() goto(turtles[0].pos()) pd() for i in range(s[1]) : turtles[1].fd(1.75*[1]/100) turtles[1].lt(1) goto(turtles[1].pos()) done()

16th Nov 2022, 12:22 PM
Mail Aja
Mail Aja - avatar
6 Réponses
0
There are more problems here than indentation errors.
17th Nov 2022, 12:04 PM
Bob_Li
Bob_Li - avatar
+ 1
if you are copy pasting, beware of hidden characters, special characters or text-formatting which would mess up the code. Also, turtle graphics don't work in Sololearn.
17th Nov 2022, 12:21 PM
Bob_Li
Bob_Li - avatar
+ 1
#Mail Aja try this in Pydroid or in your computer from turtle import Turtle, Screen sc = Screen() #choose colors : colors = ["deeppink", "gold", "cyan", "orange"] sc.bgcolor ("black") r=[200,200] #circle size s=2,32 #pattern size turtles = [Turtle( ), Turtle( )] for index,t in enumerate(turtles) : t.speed(0) t.color("white") t.shape("circle") t.shapesize(0.3) t.width(3) t.pu() t.seth(90) t.fd(r[index]) t.seth(180) sc.tracer(30) t.speed(0) t.ht() for i in colors: t.color(i) t.pu() for i in range(360//min(s)): for i in range(s[0]) : turtles[0].fd(1.75*r[0]/100) turtles[0].lt(1) t.goto(turtles[0].pos()) for i in range(s[1]) : turtles[1].fd(1.75*r[1]/100) turtles[1].lt(1) t.pd() t.goto(turtles[0].pos()) sc.mainloop() sc.done()
17th Nov 2022, 12:55 PM
Bob_Li
Bob_Li - avatar
+ 1
Mail Aja you can try the skulpt library with this example I borrowed from Solo. I loaded the code above. Some methods are not supported, and resizing may be needed, but it looks essentially the same. Nothing is impossible, if you have the determination. Copy paste is convenient, but debugging is where you learn stuff. Keep at it.🤓 https://code.sololearn.com/W5p8py4K6k3O/?ref=app
17th Nov 2022, 2:14 PM
Bob_Li
Bob_Li - avatar
0
thanks bro.. I just copy paste in a post, I really want to be able to code but I don't have the slightest ability🤧
17th Nov 2022, 12:16 PM
Mail Aja
Mail Aja - avatar
0
thanks for the advice bro I really appreciate it, I'll try :)
17th Nov 2022, 2:47 PM
Mail Aja
Mail Aja - avatar