If else statement Question! Super easy yet confusing

What is the difference between these two codes( their outputs are different?!?! : CAN SOMEONE INTELLIGENT PLEASE EXPLain?
for i in words:
if i in dic:
dic[i] += 1
dic[i]=0

for i in words:
if i in dic:
dic[i] += 1
else:
dic[i]=0

I can’t see how that first loop would be used but without formatting it’s even harder to guess. Could you please check the following link for a little information on formatting code for the forums and how best to set up a question-

1 Like