If the user doesn't type in multiplication, addition, ect, then a string should be printed. However, if one of these words is typed it still prints this string. I've just started with python; sorry that it's such a basic question!
print ("Multiplication, Addition, Subtraction or Division?")
type = str(input("Your choice:"))
if type != "multiplication" or "addition" or "subtraction" or "division":
print("YOU DID NOT ENTER ONE OF THE ABOVE OPTIONS.\nTRY AGAIN!")
num1 = int(input("Enter your 1st number:"))
Aucun commentaire:
Enregistrer un commentaire