Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def print_blue():
- print('You chose blue!\r\n')
- def print_red():
- print('You chose red!\r\n')
- def print_orange():
- print('You chose orange!\r\n')
- def print_yellow():
- print('You chose yellow!\r\n')
- color_select = {
- 0: print_blue,
- 1: print_red,
- 2: print_orange,
- 3: print_yellow
- }
- selection = 0
- while (selection != 4):
- print('0. Blue')
- print('1. Red')
- print('2. Orange')
- print('3. Yellow')
- print('4. Quit')
- selection = int(input('Select a color option: '))
- if selection >= 0 and selection < 4:
- color_select[selection]()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement