BerkayB.2000
Centipat
- Katılım
- 11 Ağustos 2020
- Mesajlar
- 43
Python:
first=input("Enter primary color:")
second=input("Enter primary color:")
if first=="red" and second=="blue" or first=="blue" and second=="red":
print("When you mix {} and {}, you get purple.".format(first,second))
elif first=="red" and second==" yellow" or first=="yellow" and second=="red":
print("When you mix {} and {}, you get orange.".format(first,second))
elif first==" blue" and second=="yellow" or first=="yellow" and second=="blue":
print("When you mix {} and {}, you get green.".format(first,second))
else:
print("You didn't input two primary colors.")
Bu kodlamada ilk renk için blue, ikinci renk olarak yellow input olarak girildiğinde "You didn't input two primary colors" ifadesine yönlendiriyor. Nasıl düzeltebilirim?
Son düzenleyen: Moderatör: