Feb-06-2017, 04:03 PM
Typically you want to do this sort of thing with parameters and return statements:
def increment(a): return a + 1 x = increment(x)The value of x is passed as a parameter to the increment function. Internally, increment calls that value 'a'. It adds one to that value and returns it. That become the value of
increment(x)
in the final line, which is then assigned to x.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures