In this project, you are going to one hundred random rectangles filled with random colors. You will learn for loop, function, random library, and setting color with (r,g,b). Video demo
In a level 1 project, you are asked to draw a hexagon (https://pythonturtle.academy/hexagon/). Use a loop to draw Triacontagon (a polygon with 30 sides). Does it almost look like a
import turtle
turtle.speed(0)
turtle.up()
turtle.circle(250,270)
turtle.down()
turtle.begin_fill()
turtle.fillcolor(‘limegreen’)
turtle.circle(250,180)
turtle.left(90)
turtle.fd(50)
turtle.left(90)
turtle.circle(-200,180)
turtle.left(90)
turtle.fd(50)
turtle.end_fill()
turtle.left(180)
turtle.fd(50)
turtle.right(90)
turtle.begin_fill()
turtle.fillcolor(‘red’)
turtle.circle(200,180)
turtle.left(90)
turtle.fd(400)
turtle.end_fill()
turtle.up()
turtle.goto(-130,230)
turtle.down()
turtle.begin_fill()
turtle.fillcolor(‘black’)
turtle.circle(25)
turtle.end_fill()
turtle.up()
turtle.goto(-135,220)
turtle.down()
turtle.begin_fill()
turtle.fillcolor(‘white’)
turtle.circle(15)
turtle.end_fill()
turtle.up()
turtle.goto(130,230)
turtle.down()
turtle.begin_fill()
turtle.fillcolor(‘black’)
turtle.circle(25)
turtle.end_fill()
turtle.up()
turtle.goto(125,220)
turtle.down()
turtle.begin_fill()
turtle.fillcolor(‘white’)
turtle.circle(15)
turtle.end_fill()
turtle.up()
turtle.pensize(10)
turtle.goto(15,100)
turtle.circle(15,270)
turtle.down()
turtle.circle(15,-180)
Nice. It works!