-
Notifications
You must be signed in to change notification settings - Fork 0
/
draw_shapes.py
51 lines (43 loc) · 998 Bytes
/
draw_shapes.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
44
45
46
47
48
49
50
51
import turtle
t = turtle.Pen()
import sys
import random
import draw_circles, draw_squares, draw_triangles, draw_random
draw_circles.t = t
draw_squares.t = t
draw_triangles.t = t
draw_random.t = t
turtle.setup(650,620)
t.up()
t.goto(-300,260)
t.down()
t.speed(0)
print('Hey there! So you want to draw some shapes, eh?')
def hello():
print('What do you want to draw? Circles, squares, triangles.. or let me pick?')
ans = sys.stdin.readline()
ans = ans.strip()
if ans == 'circles':
draw_circles.draw_circles()
if ans == 'squares':
draw_squares.draw_squares()
if ans == 'triangles':
draw_triangles.draw_triangles()
if ans == 'you pick':
print('Yay!')
draw_random.draw_random()
def draw_again():
t.up()
t.setx(-300)
t.right(90)
t.forward(50)
t.left(90)
t.down()
def again():
while True:
print('Press enter to draw again')
input()
draw_again()
hello()
hello()
again()