Question: Look at the RGB basic color chart on this website. Create a program that: Asks the user to enter in the name of a color
-
Look at the RGB basic color chart on this website. Create a program that:
-
Asks the user to enter in the name of a color
-
If the color is one of the basic colors, print the HEX code (e.g. #BADA55). Note that this is just the basic colors (16 total colors)
-
If the color is not on the basic color chart, tell the user that the color was not found and prompt for another color.
-
Make sure the input is NOT case-sensitive (check out .lower()). Also, I highly recommend using a dict to store the colors and codes. I recommend checking out how to check if a key is in a dict. You can either use a while loop or a recursive function, as you prefer (though Ill be happier with a recursive function)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
