Learning/relearning Python. Grotesqeuly simple question:
How do I get hold of the value of y from outside this class?
# Try to work out how classes are called.
def __init__(self, x):
print "init called", self, x
def f(self, x):
print "f called", self, x
y = x + 1
....I want to put something like:
anticipating it will print the number 5. It never will.
How do I name the value of y? Does the class need changing somehow?
Thanks any help.