version 1
Code:
annual_income = 1100
Personal_Allowance_percent = 0
Basic_Rate_percent = 20
Higher_Rate_percent = 40
Additional_Rate_percent = 45
Personal_Allowance = 11500
Basic_Rate = 45000
Higher_Rate = 150000
tax = 0
if annual_income <= Personal_Allowance:
tax = (Personal_Allowance_percent * annual_income / 100)
elif annual_income <= Basic_Rate:
tax = (Basic_Rate_percent * annual_income / 100)
elif annual_income <= Higher_Rate:
tax = (Higher_Rate_percent * annual_income / 100)
else:
tax = (Additional_Rate_percent * annual_income / 100)
income_taxed = annual_income - tax
print("TAX: ",tax)
print("AFTER TAX:",income_taxed)
Disclaimer: Don't be misguided looking at my usergroup and assume whatever I say is official. When I speak in community I am just a member with personal opinions.