repl.it
@Raluca79/

Q2_K3102155.py

Python (with Turtle)

No description

fork
loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Draw squares across page
from turtle import *
number_of_squares=4
for shape in range(1,number_of_squares+1):
  # Draw a square
  for sides in range(1,5):
    forward(20*shape)
    left(90)
  # Move forward to start position of next square
  penup()
  right(90)
  forward(20*(shape+1)+10)
  left(90)
  forward(20*shape+10)
  pendown()
result
console
?