Anthony Liu wrote: > I defined two functions, f1 and f2. > > f1 modifies the value of a variable called apple. > > I want to pass the modified value of apple to f2. > > How can I do this? I got stuck.
Py>def f1(apple): ... apple += 1 ... f2(apple) py>def f2(apple): ... print 'you have %s apples' % apple py>f1(4) 'you have 5 apples' Read the docs this is pretty basic, it will save you time. If in doubt try it out. Use the interpreter, it is your friend. hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list