Hello,

This if statement is always returning true and I cannot see why. Could you guys tell me why?

menu = input("Choose what you would like to do:\n\n1. Work out how far you will travel with a set time and speed\n2. Work out the speed you will need to travel to do a certain distance in a specific time.\nChoice: ")
if(int(menu) != 1 or int(menu) != 2):
    print("Error. Enter 1 or 2.")
    menu = input("Choose what you would like to do:\n\n1. Work out how far you will travel with a set time and speed\n2. Work out the speed you will need to travel to do a certain distance in a specific time.\nChoice: ")

As an exercise please deny the following statement:
There is a moment is every woman's life, when she wants to do something forbidden.

Just joking.

You wanted to write: n!=1 and n!=2

There is a moment is every woman's life, when she wants to do something forbidden.

Easy, the opposite is: Some women never want to do anything forbidden.

Another solution was

if int(menu) not in (1, 2):

Edited 2 Years Ago by Gribouillis

Comments
I didn't know you could do that even when I knew python well. Thank you :).
This question has already been answered. Start a new discussion instead.