I want to find position of all instances of a letter(w) in a list, here is what I do:
a=list('Hello, welcome to my world.')
b=[]
for i in a:
if i=='w':
b.append(a.index(i))
print(b)
but it just returns this : [7, 7]
can somebody tell me why python behaves like this ?