Using Dictionary with list manipulation
<p>How do you use dictionary to find the index in the elements of the list however it should return the index of the same element.</p>

<p>This will work :</p>

<pre><code>    text = "I like cheese bcoz cheese in great"
    hash = {}
    words = text.split(" ")
    for i in range(1:len(words)):
       word = words[i] 
       if word not in hash.keys():
             hash[word] = i

    for word in words:
       print hash[word]
</code></pre>

python