Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- primary = ["red","blue","yellow"]
- final_color = ''
- color_1 = input('Enter primary color:')
- color_2 = input('Enter primary color:')
- if(color_1 not in primary or color_2 not in primary):
- print("You didn't input two primary colors.")
- else:
- if((color_1 == 'red' and color_2=='blue') or (color_2 == 'red' and color_1=='blue')):
- final_color = 'purple'
- elif((color_1 == 'red' and color_2=='yellow') or (color_2 == 'red' and color_1=='yellow')):
- final_color = 'orange'
- elif((color_1 == 'blue' and color_2=='yellow') or (color_2 == 'blue' and color_1=='yellow')):
- final_color = 'green'
- print(f'When you mix {color_1} and {color_2}, you get {final_color}.')
Add Comment
Please, Sign In to add comment