Create a final IF/ELSE statement to evaluate the validColor flag. If a valid color was entered, use string concatenation to display the English color (color) and its Spanish equivalent (spanishColor).

Responsive Centered Red Button

Need Help with this Question or something similar to this? We got you! Just fill out the order form (follow the link below), and your paper will be assigned to an expert to help you ASAP.

Print a string statement with a list of acceptable colors to the screen:
“Your color choices are red, blue, green, white or yellow.”
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Print Statements.
Prompt the user to enter a color value from the list. Assign the user input to a variable (i.e., userColor).
“Enter a color from the list above: ”
Reference: Refer back to your Unit 1 readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 3: Built-In Functions / Getting Input From the User.
Convert the color value entered to all lowercase for easier evaluation. Use the string function lower and store the lowercase color in a new variable (i.e., color).
Reference: Refer back to your Unit 1 readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 8: Built-In String Operations.
Create a variable named validColor and set it to a value of true.
Using a series of IF/ELIF statements, evaluate the color and set a new variable (i.e., spanishColor) to the appropriate Spanish equivalent. Use a final else statement if a valid color was not entered, and assign the validColor flag to a value of false.
red = rojo
blue = azul
green = verde
white = blanco
yellow = amarillo
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 5: The if Statement / Comparison Operators / The elif Statement / Using Many elif Statements.
Create a final IF/ELSE statement to evaluate the validColor flag. If a valid color was entered, use string concatenation to display the English color (color) and its Spanish equivalent (spanishColor). If not, display a message indicating a valid color was not entered.
Reference: Refer back to your Unit 1 readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Print Statements; Chapter 3: Built-In Functions / Concatenation.
EXAMPLE OUTPUT
Your color choices are red, blue, green, white or yellow.
Enter a color from the list above: rEd
The color red in Spanish is rojo
Your color choices are red, blue, green, white or yellow.
Enter a color from the list above: black
That is not a valid color for this program. Ese no es un color válido.

How to create Testimonial Carousel using Bootstrap5

Clients' Reviews about Our Services