Avi Gross wrote at 2022-3-4 16:43 +0000:
>Your use is creative albeit it is not "needed" since all it does is make sure 
>your variable is initialized to something, specifically None.
>
>So would this not do the same thing?
>
>  eye = None
>
>  for eye in range(0):
>      print(eye)
>
>  eye

It would.

But, the `for` construct's main purpose is often to determine
a value for the loop variable and in this case, I like
that it itself can ensure that it gets a value.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to