Sep-23-2017, 02:06 PM
To get a value out of a function, you return it. Then you can either print it directly, or assign it to a variable and print it later:
def add2(x): return x + 2 print(add2(3)) eight = add2(6) print(eight)
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