filmov
tv
Python Turtle Code: Filled Circles

Показать описание
A classic spirograph of circles in the middle surrounded by small, color-filled ones. The Python Turtle code uses two loops: one for the classic spirograph in the middle and the other for the color-filled ones at the edge.
Please feel free to copy and paste the code below. Feel free, too, to ask questions, if you have any, about the code. Enjoy!
import turtle
scrin = turtle.Screen()
t = turtle.Turtle()
for i in range(18): #for the classic spirograph of circles at the center
for j in range(6): #for the 6 groups of multicolored circles at the edge
for k in ["red", "green", "blue"]: #each group is composed of three small circles with these colors
Please feel free to copy and paste the code below. Feel free, too, to ask questions, if you have any, about the code. Enjoy!
import turtle
scrin = turtle.Screen()
t = turtle.Turtle()
for i in range(18): #for the classic spirograph of circles at the center
for j in range(6): #for the 6 groups of multicolored circles at the edge
for k in ["red", "green", "blue"]: #each group is composed of three small circles with these colors