我刚刚开始使用 python 编程课程,并且必须编写一个程序,让用户输入两种原色并打印生成的二次色。我了解 python 的大部分初学者步骤,但似乎总是跳过一些事情或在这里和那里错过一步。有人可以告诉我我做错了什么吗?
color1 = input("Choose your first color. (red, blue, yellow) :")
color2 = input("What is your second color? (red, blue, yellow) :")
if color1 == red and color2 == blue or color1 == blue and color2 == red:
print("Your result is purple")
elif color1 == red and color2 == yellow or color1 == yellow and color2 == red:
print("Your result is orange")
elif color1 == blue and color2 == yellow or color1 == yellow and color2 == blue:
print("your result is green")