Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 color and color
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 casesensitive you have to be prepared to handle all variations of color inputs eg 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started