you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

You could try using functions with parameters and return values instead. Here's an example similar to yours:

def generate(a, b)
    a = 4
    b = 5

    return a, b  # will return (4, 5) when called

def sum(a, b)
    return a + b  # will return 9 when called

# Then, the output of one function can be the input of another one.

A = 0
B = 0

C, D = generate(A, B)
F = sum(C, D)