sentence = \"ask not what your country can do for you ask what you can do for your country\"
sentList = sentence.split()
print(sentence)
userWord = input(\"Pick a word
list.index accepts additional start index (and end index). Pass the index to find next matched item index.
...
if userWord in sentList:
i = 0
while True:
try:
i = sentList.index(userWord, i) # <---
except ValueError: # will raise ValueError unless the item is found
break
i += 1
print("{} appears in the sentence in the {}th position".format(
userWord, i
))
else:
....