Python 3.6 feedback request:

Soldato
Joined
27 Jan 2012
Posts
7,968
Location
The king of the north!
Hi all looking for any feedback for my little calculator that I made this morning.

A couple of us are looking at taking some weekend work to boost our income but couldn’t find an calculator for two incomes so decided to make one following the governments guidelines for tax/wages/NI

this was done entirely on a phone so the formatting might look different for you than it does for me.

#Author Harry O'Neill


Job_One_Income = float(input("What is the hourly rate of your first income? :"))
Job_One_Hours = float(input("How many hours are you paid for working in your first job per week? :"))
Job_One_Yearly_Income = float(round(Job_One_Income * Job_One_Hours * 52,2))

Job_Two_Income = float(input("What is the hourly rate of your second income? :"))
Job_Two_Hours = float(input("How many hours are you paid for working in your second job per week? :"))
Job_Two_Yearly_Income = float(round(Job_Two_Income * Job_Two_Hours * 52, 2))

National_Insurance = 12 # 12% after £183
Tax_Limit = 37000
Tax_Allowance = 12500

Yearly_Income = Job_One_Yearly_Income + Job_Two_Yearly_Income
Weekly_Income = Yearly_Income / 52
Weekly_NI =((Weekly_Income - 183) * 0.12)

Yearly_Taxable_Income = Job_One_Yearly_Income + Job_Two_Yearly_Income - Tax_Allowance
Weekly_Taxable_Income = Yearly_Taxable_Income / 52

if Yearly_Taxable_Income <= (Tax_Limit + Tax_Allowance):
Weekly_Tax = (Weekly_Taxable_Income * 0.20)

else:
Weekly_Tax = (Weekly_Taxable_Income * 0.40)

Yearly_Tax = round(Weekly_Tax * 52,2)

Weekly_Take_Home = round(Weekly_Income - Weekly_NI - Weekly_Tax,2)

Yearly_Take_Home = round(Weekly_Take_Home * 52,2)


Monthly_Take_Home = round(Yearly_Take_Home / 12,2)

print("\n")

print(f"Yearly Income : £{Yearly_Take_Home} \n")
print(f"Monthly Income : £{Monthly_Take_Home}\n")
print(f"Weekly Income : £{Weekly_Take_Home}\n")


if Yearly_Income <=(Tax_Limit + Tax_Allowance):
print(f"your income is within the lower tax bracket and you will be taxed £{Yearly_Tax} per year ")

else:
print(f"You are earning above the tax limit and will be taxed highly at £{Yearly_Tax} per year")

What would you have done differently to make this a better piece of code?

Thanks for any feedback
 
Back
Top Bottom