Computing - Using loops in Python 28.11.23
28 Nov 2023
Today you are using
Trinket to create a shape design using code.
Repeated circle design
import turtle
tina
= turtle.Turtle( )
def home( ):
tina.penup( ) tina.setx(-140)
tina.sety(90)
home( ) tina.speed(0)
tina.pencolor(4, 86, 26)
tina.fillcolor(216, 119, 0)
for i
in range(8):
for i
in range(8):
tina.pendown( )
tina.begin_fill( )
tina.circle(50)
tina.end_fill( )
tina.penup( )
tina.forward(40)
tina.back(320)
tina.right(90)
tina.forward(40)
tina.left(90)
home( )
for i
in range(8):
for i
in range(8):
tina.pendown( )
tina.circle(50)
tina.penup( )
tina.forward(40)
tina.back(320)
tina.right(90)
tina.forward(40)
tina.left(90)
Challenge
Go onto
Trinket and tinker with this code to create your own repeated circles.