how to use goto in python turtle

Solutions on MaxInterview for how to use goto in python turtle by the best coders in the world

showing results for - "how to use goto in python turtle"
Martina
10 Aug 2016
1#Draw a set of nested squares, increasing in size
2from turtle import *
3
4number_of_shapes = 4
5
6for shape in range(1, number_of_shapes + 1):
7    #Draw a square
8    for sides in range(1,5):
9        forward(20 + shape * 10)
10        right(90)
11
12#Move to position of next square
13    penup()
14    goto(shape * 10, shape * 10)
15    pendown()
16