+ 1
Why won't my program substract correctly?
Here it is, hope you can help me: print("Hi, select the calculation you want to make") print("Add or Substract") selection = input(":") if selection == "Add" or "add": x = int(input("Enter your first number: ")) y = int(input("Enter the second number: ")) print(x + y) elif selection == "Substract" or "substract": a = int(input("Enter your first number: ")) b = int(input("Enter the second number: ")) print(a - b) else: print("Unknown Command")
2 Respostas
+ 1
write your input and the result please
+ 1
If I input Substract, then 5, and then 4 it gives me 9, I think that it executes the "add" lines instead of the "Substract" ones