In: Computer Science
gross_salary = float(input("Enter the gross salary "))
def calculate_gross(gross_salary):
if gross_salary > 50000:
net_income = gross_salary - (gross_salary * 50 /100 )
if gross_salary > 25000:
net_income = gross_salary - (gross_salary * 25 /100 )
if gross_salary > 10000:
net_income = gross_salary - (gross_salary * 10 /100 )
if gross_salary < 10000:
net_income = gross_salary
return gross_salary, net_income
gross_salary, net_income = calculate_gross(gross_salary)
print("Gross salary is {} and Net income is {}".format(gross_salary, net_income))
I have attached the code and screenshot of the output . If you like my answer please give me a thumbsup and if you have any query please get back to me in the comment section will be happy to help you.