For example if an example input is: ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU ASK WHAT YOU CAN DO FOR YOUR COUNTRY
My program must return: The word ‘COUNTRY’ occurs in the 5th and 17th positions.
I only need help for the part in finding if the string occurs more than once.
This is my attempt so far, I am new in python so sorry if my question seems too easily answered.
# wordsList=[]
words=input("Enter a sentence without punctuation:\n")
# wordsList.append(words)
# print(wordsList)
for i in words:
if i in words>1:
print(words)
# words.split(" ")
# print(words[0])