Why does money print as 0 rather than as the entered values? How can I extract the variable from this function to be used elsewhere in the program?
money = 0
def enterMoney(money):
moneyInsert = float(input("How much money do you want to desposit into the machine? \n (Minimum $10): "))
money = float(money) + float(moneyInsert)
if money < 10:
print("Not enough money entered, please enter more.")
enterMoney(money)
# mainline #
print ("======================================")
print (" WELCOME TO CASINO DWARFS MACHINE! ")
print (" ENTER MONEY AND BEGIN! ")
print (" ")
enterMoney(money)
print (money)