python turtle generative art

Solutions on MaxInterview for python turtle generative art by the best coders in the world

showing results for - "python turtle generative art"
Fabiana
12 Sep 2017
1import turtle
2
3                            running = True
4
5                            while running:
6                            print('enter triangle, square, or exit:')
7                            entered = input()
8
9                            if entered == 'triangle':
10                            for i in range(3):
11                            turtle.forward(100)
12                            turtle.right(120)
13
14                            elif entered == 'square':
15                            for i in range(4):
16                            turtle.forward(100)
17                            turtle.right(90)
18
19                            elif entered == 'exit':
20                            running = False
21                            print('exiting...')
22
23                            else:
24                            print('not a command')
25
26                            print('bye!')