Jun-09-2022, 02:36 PM
This question has nothing to do with hex codes. It has nothing to do with color mixing. The assignment is about input verification and logic.
Your program needs to print instructions to the user and take user input. You've demonstrated you know how to print instructions. Do you know how to take user input?
Once you get user input you may need to process it to derive a result to print. Looks like you intend to do something like this:
How do you do the comparison? Are red and blue going to be the strings "red" and "blue"? What if the user types "Red" and "BLUE"? Those should be identified as primary colors. How can you make the string comparison case insensitive?
What should you do if the user enters "blue" and "blue"? These are both primary colors, and if you mix them you get blue. Should your program print "blue" or should it warn that the colors cannot be the same?
Your program needs to print instructions to the user and take user input. You've demonstrated you know how to print instructions. Do you know how to take user input?
Once you get user input you may need to process it to derive a result to print. Looks like you intend to do something like this:
If the two primary colors are red and blue print purple else if the two primary colors are blue and yellow print green else if the two primary colors are red and yellow print orange else print error messageHow do you convert this pseudo code into Python? "two primary colors" sounds like a container that can hold multiple values. Which Python types can contain more than one value?
How do you do the comparison? Are red and blue going to be the strings "red" and "blue"? What if the user types "Red" and "BLUE"? Those should be identified as primary colors. How can you make the string comparison case insensitive?
What should you do if the user enters "blue" and "blue"? These are both primary colors, and if you mix them you get blue. Should your program print "blue" or should it warn that the colors cannot be the same?