Calculate the gross salary and net salary of an employee

A Python program to calculate the gross salary and net salary of an employee.

  • Gross Salary = basic salary + da + hra
  • Net Salary = gross salary - pf - income tax

Source Code:

def da(basic):
   da = basic*80/100
   return da

def hra(basic):
   hra = basic*15/100
   return hra

def pf(basic):
   pf = basic*12/100
   return pf

def itax(gross):
   tax = gross*0.1
   return tax

basic = float(input("Enter basic salary: "))

gross = basic+da(basic)+hra(basic)
print("Your gross salary: {:10.2f}".format(gross))

net = gross-pf(basic)-itax(gross)
print("Your net salary: {:10.2f}".format(net)) 

 

Comments