Quote:
I dont understand why. Please explain
Simple, you have mixed spaces and tab differently from previous line.
p="foo foo quux labs foo barquux".split()
d={}
s=[]
count=1
for x in p:
if x not in s:
d.update({x:count})
s.append(x)
else:
d[x]+=1
print(d)
Visually it is the same, but not for the compiler.