Computer Science, asked by yp1232, 1 year ago

write a python script to mix different colors

Answers

Answered by bighnesh94
8

Answer:

Prompt:

The colors red, blue, and yellow are known as the primary colors because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color: When you mix red and blue, you get purple. When you mix red and yellow, you get orange. When you mix blue and yellow, you get green.

Design a program that prompts the user to enter the names of two primary colors, one at a time. If the user enters anything other than "red," "blue," or "yellow," the program should print "You didn't input two primary colors." Otherwise, it should print something in the format:

"When you mix red and blue, you get purple." (Assuming the user entered "red" and "blue”.)

My program kept getting wrong standard output

Here's what I wrote:

primary_colora = input("Enter primary color:")

primary_colorb = input("Enter primary color:")

primary_colors = primary_colora or primary_colorb

if primary_colora == (red, blue, yellow):

   primary_colora = True

elif primary_colorb == (red, blue, yellow):

   primary_colorb = True

elif primary_colors == red or blue:

   print("When you mix red and blue, you get purple")

elif primary_colors == yellow or blue:

   print("When you mix yellow and blue, you get green")

elif primary_colors == yellow or red:

   print("When you mix yellow and red, you get orange")

else: print("You didn't input two primary colors.")

Explanation:

Similar questions