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,682
  • 1
  • 16
  • 35

0 Answers0