Question: Goal: Learn to write a full I / O app with conditional flows. Assignment: In traditional arts, color theory is an important framework that enables
Goal: Learn to write a full IO app with conditional flows.
Assignment: In traditional arts, color theory is an important framework that enables a deeper understanding of colors and their relationships.
A simple example is complementary colors. Simply put, when mixing two colors and obtaining a white, gray or black color, we call them complementary colors.
Consider a color wheel of six colors, made up of the following pairs of complementary colors:
red and green;
yellow and purple;
blue and orange.
Write a program that prompts the user to enter the names of two colors, one at a time.
If the user enters anything other than one of the six colors mentioned above, the program should print "You did not enter one of red, orange, yellow, green, blue or purple". Otherwise, it should print the following message: if the two colors are complementary, print "The two colors are complementary";
otherwise, print "The two colors are not complementary".
in python code without def
Sample run: user input put between
Enter the first color:
Enter the second color:
The two colors are complementary.
Enter the first color:
Enter the second color:
The two colors are not complementary.
Enter the first color:
Enter the second color:
You did not enter one of red, orange, yellow, green, blue or purple.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
