Question: What code should I write in Python? Given primary colors ( Red , Blue, and Yellow ) create a sequence of if , elif, and

What code should I write in Python?
Given primary colors (Red, Blue, and Yellow) create a sequence of if, elif, and else statements that will "calculate" two colors mixing.
Your code must:
Take user input for color1 and color2.
Account for all possible color outcomes given those two inputs: *Notice some color combos are similar. Remember the user can input colors in different orders!
o Red + Red = Red
o Red + Blue = Purple
o Red + Yellow = Orange
o Blue + Blue = Blue
o Blue + Red = Purple
o Blue + Yellow = Green
o Yellow + Yellow = Yellow
o Yellow + Red = Orange
o Yellow + Blue = Green
You must also account for user input errors or invalid inputs, since Python is case-sensitive you have to be prepared to handle all variations of color inputs (e.g. red, Red, RED, rEd). Also, be aware a user could input absolutely anything so even though you expect only the three primary colors you also have to account for the user entering something like Shoe. What are you going to do in these cases?
Example of what an output could be:Choose a primary color (Red, Blue, or Yellow) Yellow
Choose a second primary color (Red, Blue, or Yellow) Blue
Yellow and Blue combined create green.
 What code should I write in Python? Given primary colors (Red,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!