1

I just realized that

for i in range(5):
    pass

print(i)
# >>> 4

And it caused a bug for me in a different situation. I always thought that i should disappear after the for loop.

Any explanation why it shouldn't?

Thanks!

jxie0755
  • 1,582
  • 1
  • 12
  • 28

0 Answers0