I have just started using python and I am doing this function exercise but I don’t understand the error. As budget is an argument of int type. I am not sure why it gives me type erroe tuple and int not supported.
Write your over_budget function here:
def over_budget(budget,food_bill,electricity_bill,internet_bill,rent):
sum=food_bill+electricity_bill,internet_bill+rent
if (budget<(sum)):
return True
else:
return False
print(over_budget(100, 20, 30, 10, 40))
print(over_budget(80, 20, 30, 10, 30))
Error
Traceback (most recent call last):
File “script.py”, line 9, in
print(over_budget(100, 20, 30, 10, 40))
File “script.py”, line 4, in over_budget
if (budget<(sum)):
TypeError: ‘<’ not supported between instances of ‘int’ and ‘tuple’