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

  1. Look at the RGB basic color chart on this website. Create a program that:

    1. Asks the user to enter in the name of a color

    2. 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)

    3. 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

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!