Answers for "python turtle generative art"

0

python turtle generative art

import turtle

                            running = True

                            while running:
                            print('enter triangle, square, or exit:')
                            entered = input()

                            if entered == 'triangle':
                            for i in range(3):
                            turtle.forward(100)
                            turtle.right(120)

                            elif entered == 'square':
                            for i in range(4):
                            turtle.forward(100)
                            turtle.right(90)

                            elif entered == 'exit':
                            running = False
                            print('exiting...')

                            else:
                            print('not a command')

                            print('bye!')
Posted by: Guest on October-08-2020

Python Answers by Framework

Browse Popular Code Answers by Language