Don't use globals unless absolutely necessary, it will get you in trouble as your programs grow longer.
pass arguments and return values instead.
Example:
pass arguments and return values instead.
Example:
def perform_math(x, y): return x + y print(perform_math(1, 2))result:
Output:3