I am making a program which would ask the user to type in a word they want to know the position of in a list. However I am encountering a problem.
When I run my program providing the word "ask" as input, it doesn't print the sentence "Your number is in the num 'st position!". I expect it to be printed twice, as the word is in the list twice at exactly those positions.
Instead, the output is:
1
10
None
This is my code:
food = "ask not what your country can do for you ask what you can do for your country"
food2 = food.split()
print (food)
word = (input("Enter Word: "))
for (num, x) in enumerate(list(food2)):
if word == x:
print (num + 1)
if num == "1" and "10" :
print ("Your number is in the ",num,"st position!")