I am doing a fitness program in Python and I need to collect information about the user. The rest of the code works fine except when collecting gender.
I want the code to repeat the question if the answer M, F, m or f is not entered. However when I run this code, even when I type in M, F, m or f, it says "Please enter M for Male or F for Female".
gender = input("What is your gender? M/F: ")
while gender != "M" or "F" or "m" or "f":
print("Please enter M for Male or F for Female.")
gender = input("What is your gender? M/F: ")
I have tried replacing !=
with is not
with no success.