I got this code on python.org
class A:
a = 42
b = list(a + i for i in range(10))
Here defined a = 42 and in the loop a + i is done but when i see the result it returns in b is.
A.b
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
I tried to understand it but couldn't. Can someone please reply how this code is working. Not defining a = 42 doesn't make any error. Then how i is being added to a when a is not defined