Python Condition, 13. Write a Python program to input basic salary of an employee and calculate its Gross salary according to following:
13. Write a Python program to input basic salary of an employee and calculate its Gross salary according to following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
Solution :-
basic = float(input("Enter the Salary :-"))
if (basic <=10000):
da = basic *0.8
hra = basic *0.2
elif(basic <=20000):
da = basic *0.9
hra = basic *0.25
else:
da = basic *0.95
hra = basic *0.3
gross = basic + hra + da
print("The Gross Salary is :-",gross)
Output :-