Oct-21-2020, 03:09 AM
(Oct-21-2020, 02:51 AM)bowlofred Wrote: In showIncome(), aRevenue
isn't assigned. So when it's used on line 23, it doesn't know what the value should be. It needs to be set to something, or it needs to not be used.
I see now, how would I go about setting that value? I tried making a variable named as aRevenue but how would i get it to call the info i need from the calcIncome?
def showIncome(num_aTickets, num_bTickets, num_cTickets): aRevenue = calcIncome() bRevenue = calcIncome() cRevenue = calcIncome() income = calcIncome(num_aTickets, num_bTickets, num_cTickets) print('the revenue collected from total ticket sales is', income) print('the revenue collected from class a ticket sales is', aRevenue) print('the revenue collected from class b ticket sales is', bRevenue) print('the revenue collected from class c ticket sales is', cRevenue) showIncome(1, 2, 3)I tried the above by placing it in the showIncome but that came back as
Error:Traceback (most recent call last):
File "main.py", line 35, in <module>
showIncome(1, 2, 3)
File "main.py", line 25, in showIncome
aRevenue = calcIncome()
TypeError: calcIncome() missing 3 required positional arguments: 'aTickets', 'bTickets', and 'cTickets'