dimanche 29 septembre 2019

my if and elif is not working properly how to fix? its only printing the first statement no matter what choice you pick

peso_value = int(input("Enter PESO value:\n"))
print("""
Menu:
[A]Dollar
[B]Yen
[C]Rial
""")
choice = input("choice: ")
if choice == 'A' or 'a':
    print('\nDollar Value:%.2f' % (peso_value / 52.04))
elif choice == "B" or "b":
    print('\nYen Value:%.2f' % (peso_value / .048))
elif choice == "C" or "c":
    print('\nRiyal Value:%.2f' % (peso_value / 0.072))
else:
    print("Invalid Choice")

'''it only prints the dollar value no mattter what choice you pick'''

Aucun commentaire:

Enregistrer un commentaire