I'm trying to learn more about Python functions and I can't get past this road block
I'm trying to use two different functions, where each one adds a number to a file when the button gets clicked and then the final function takes in this number and reports the sum. But I keep getting a missing required positional arguments error, I'm just starting with Python and I would appreciate any help.
def printB1(event, bill1):
f = open('myfile.txt', 'a')
f.write('$10.99\n')
bill1 += 10.99
return bill1
def printB2(event, bill2):
f = open('myfile.txt', 'a')
f.write('$3.99\n')
bill2 += 3.99
return bill1
def printB6(event, bill1, bill2):
sumTotal = (bill1 + bill2)
f = open('myfile.txt', 'a')
f.write(sumTotal)
b1 = Button(topFrame, text="B1", foreground="red")
b1.bind("<Button-1>", printB1)
tkinter?