How do I pass multiple (2 or more) variables from a function to another in python? I have searched all around the internet, yet I am unable to understand most of the explanations given, many examples just do not fit my case, and I cannot fix the problem with a MRE. Here is the example code:
def prompt_user():
money1 = input("insert a value")
money2 = input(" insert another value")
return money1, money2
def add(money1, money2):
cash = int(money1) + int(money2)
return cash
two_values = prompt_user()
total = add(two_values)
print("you have "+ str(total))
Is this just unable to be done in python? Or do you have to use something like lists to pass arguments in this case?
Examples I have found(yet not understood): Python — Passing Multiple Arguments https://www.geeksforgeeks.org/how-to-pass-multiple-arguments-to-function/
EDIT: I fixed it. Turns out we have to break the tuple when passing values from another function. Thank you everyone.