I'm trying to compare 2 elements : one is a user input and the other is an element from a list. The fact is that when the user enter a value that is in the list, the program print "Ok". But since there's two type of element in my list (integer and string), the user can only compare his value with every string of the list...
list = ["test", "testOne", 5, 10]
continuer = True
while continuer:
word = input("Enter a word : ")
for elements in list:
if word in list:
print("Ok")
break
else:
print("Not ok")
break
I really need these numbers to be integers, can you give me some advices ? Thanks !