Write a program that has two functions main() and validate(). Use these two functions to get colors from the user and validate it against the KnownColors list. indicate to the user that the input was valid or not. The program should only end when the user enters in exit. KnownColors = I'red'. 'areen' 'blue' vellow' orange', indigo'l

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

Language Python

Write a program that has two functions main() and validate(). Use these two functions to get colors from the user and validate it against the KnownColors list. Please
indicate to the user that the input was valid or not. The program should only end when the user enters in exit.
KnownColors
= ['red', 'green','blue',yellow',orange', indigo']
%D
Transcribed Image Text:Write a program that has two functions main() and validate(). Use these two functions to get colors from the user and validate it against the KnownColors list. Please indicate to the user that the input was valid or not. The program should only end when the user enters in exit. KnownColors = ['red', 'green','blue',yellow',orange', indigo'] %D
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT