SyntaxFix
Write A Post
Hire A Developer
Questions
Or Use range (python 3):
range
l=[i for i in range(len(lst)) if lst[i]=='something...']
For (python 2):
l=[i for i in xrange(len(lst)) if lst[i]=='something...']
And then (both cases):
print(l)
Is as expected.