Login and get coding
In this Bite we'll get you to take user input using the
inputbuiltin and see if it matches items within a list.
whileloop ask the user to enter a color and capture that input.
Check to see whether they've entered 'quit'. If so, print bye and exit (
break) the loop, effectively ending the function.
If not, check to see whether the color (input) is in the
VALID_COLORScolor list. If it is, then print the color in lower case. If not, print Not a valid color and
As you want to ask the user over and over again till they quit, you can use an infinite
whileloop. We already provided that in the template code, just code inside that loop.
4626 out of 5141 users completed this Bite.
Will you be Pythonista #4627 to crack this Bite?
Resolution time: ~29 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 4.0 on a 1-10 difficulty scale.
» Up for a challenge? 💪