0
我试图显示两种混合素数颜色的二次色。我有点卡在代码上,但它似乎在我运行它时都会检查,它总是显示我放入的其他错误消息。我该怎么做?!Python的颜色练习
print('Choose two primary colors to get their secondary color.')
print('Choose the number 1 for red, 2 for blue and 3 for yellow.')
red = 1
blue = 2
yellow = 3
def main():
prime_1 = input('Enter your first primary color: ')
prime_2 = input('Enter your second primary color: ')
if prime_1 == red and prime_2 == blue:
print('Your secondary color is purple!')
elif prime_1 == yellow and prime_2 == red:
print('Your secondary color is orange!')
elif prime_1 == blue and prime_2 == yellow:
print('Your secondary color is green!')
else:
print('That is not a primary color!')
main()
哇!谢谢,我很轻松地看了一眼。这么简单哈哈 – RobertJRodriguez