[Solved] If an input is part of a list [duplicate]
It is going to depend on the type of data in the list. input returns everything as str. So if the list data type is float then the if statement will evaluate as True. For int data use the following: items = [variable1, variable2, variable3] choice = input(“Input variable here: “) if int(choice) not in … Read more