Traceback (most recent call last): File "<string>", line 1, in <string> TypeError: 'str' object is not callable
Here is my code:
def medical_amount(d_net_income, med_expenses):
'''Return the deductible amount to be entered on line 5816 of the
Ontario Tax form, based on float d_net_income, the dependant's net income.
'''
temp = med_expenses - min(1965, d_net_income * 0.03)
if temp < 0:
return 0
elif temp > 10591:
return 10591
else:
return temp
def age_amount(net_income):
'''Return the amount to be entered on line 5808: "Age amount", of the
Ontario Tax Form, based on float net_income, the taxpayer's net income.
This credit applies only to persons born in 1943 or earlier.
'''
temp = 4329 - (net_income - 31554) * 0.15
if temp < 0:
return 0
else:
return temp
def infirm(d_net_income):
'''Returns the amount to be entered on line 5820: "amount for dependants age
18 or older". based on float net_income, the taxpayer's net income.
'''
temp = 9908 - d_net_income
if temp < 0:
return 0
elif temp > 4091:
return 4091
else:
return temp
def political_amount(contribution):
'''Returns the amount to be entered on line 24 based on contribution.
There are 4 possible conditions and each have to do a different form.
'''
if contribution >= 336:
return contribution * 0.75
elif 336 < contribution < 1120:
return (contribution - 336) * 0.5 + 252
elif 1120 < contribution < 2548:
return (contribution - 1120) * 0.3333 + 644
else:
return 1120
if __name__ == "__main__":
net_income = float(raw_input("Please enter your net income:"))
d_net_income = float(raw_input("Please enter dependant's net income:"))
med_expenses = float(raw_input("Please enter dependant's medical expenses:"))
answer = raw_input("Is the dependant infirm(please enter 'yes' or 'no'):")
if answer == "yes":
Line5820 = infirm(d_net_income)
else:
Line5820 = 0
answer = int(raw_input("Please enter the year you were born(all four digits):"))
if answer < 1944:
line5808 = age_amount(net_income)
else:
line5808 = 0
contribution = float(raw_input("Please enter the amount of your political contributions:"))
line24 = political_amount(contribution)
print "Your Ontario Tax Credit is: $" (Line5820 + line5808 + line24)

New Topic/Question
Reply




MultiQuote




|