main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from turtle import *
# initialize the Turtle
tommy = Turtle()
tommy.shape("turtle")
tommy.speed(5)
# instructions for the user
tommy.penup()
tommy.color("black")
tommy.goto(0,100)
tommy.write("Check out these sweet shapes!", None, "center", "16pt bold")
# triangle logic
tommy.color("#00ff00")
tommy.penup()
tommy.goto(0,50)
tommy.pendown()
# coordinates
tommy.goto(50,-50)
tommy.goto(-50,-50)
tommy.goto(0,50)
tommy.penup()
# square logic
tommy.color( (0,150,255) )
tommy.penup()
tommy.goto(175,50)
tommy.pendown()
# relative directions
tommy.begin_fill()
tommy.right(90)
tommy.forward(100)
tommy.right(90)
tommy.forward(100)
tommy.right(90)
tommy.forward(100)
tommy.right(90)
tommy.forward(100)
tommy.end_fill()
tommy.penup()
# done!
tommy.color("black")
tommy.goto(0,-150)
tommy.write("Done!", None, "center", "16pt bold")
tommy.goto(0,-170)
result
console