Beginner's scoping question

Alan Little contact at alanlittle.org
Wed Nov 10 15:40:34 EST 2004


a=1
b=[]
class C():
   def __init__(self):
      a=2
      b.append(3)

c = C()

print b
# [3]

# but ...
print a
# 1

???



More information about the Python-list mailing list