Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
indexes = []
words = []
sentence = input("Please enter a sentence: ").lower().split()
for word in sentence:
    if word not in words:
        words.append(word)
    indexes.append(words.index(word)+1)
print(words)
print(indexes)