Write a function called calculate_tax that takes 3 arguments: your age, salary, and current job
designation.
Your first task is to take these arguments as user input and pass these values to the function.
Your second task is to implement the function and calculate the tax as the following conditions:
NO TAX IF YOU ARE LESS THAN 18 YEARS OLD.
NO TAX IF YOU ARE THE PRESIDENT OF THE COMPANY
No tax if you get paid less than 10,000
5% tax if you get paid between 10K and 20K
10% tax if you get paid more than 20K
def calculate_tax(age, salary, current_job):
if age < 18:
tax = 0
elif current_job == "presedent of the company":
tax = 0
elif salary < 10000:
tax = 0
elif salary < 20000:
tax = 0.05 * salary
else:
tax = 0.1 * salary
return tax
age = int(input("ENter your age: "))
salary = int(input("Enter your salary: "))
current_job = input("Enter your current job: ")
tax = calculate_tax(age, salary, current_job)
print("Your tax is", tax)
Comments
Leave a comment