title: Finding the original positions of words in a sentence when the word occurs more than once
body: <p>I need to find the positions of words in a sentence the user inputs and if the word occurs more than once, only print the first time that word occurs</p>
  
  <p>I have the code so far-</p>
  
  <pre><code>sentence=input("Enter a sentence: ")
  sentence=sentence.lower()
  words=sentence.split()
  place=[]
  
  for c,a in enumerate(words):
      if words.count(a)&gt;2 :
          place.append(words.index(a+1))
      else:
          place.append(c+1)
  
  print(sentence)
  print(place)
  </code></pre>
  
  <p>But it prints the positions of the individual words in the sentence rather than repeating a original position of a word that occurs more than once</p>
  
  <p>Can anyone help me with this???</p>