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>Try this:</p>

<pre><code>l = "I like cheese because cheese is great".split()
d = {}
count = 0
for word in l:
    if word not in d.keys():
        count += 1
        d[i] = count
for word in l:
    print(d[word], end=",")
print()
</code></pre>

python