Saturday, January 16, 2021

Python code for finding net salary

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

exp = int(input("Enter work experience:"))

grade = input("Enter grade:")


if(exp>=15):

    if(grade == 'A' or grade == 'a'):

        ns = sal * 2

    elif(grade == 'B' or grade == 'b'):

        ns = sal * 1.75

    elif(grade == 'C' or grade == 'c'):

        ns = sal * 1.50

    else:

        print("Invalid Input")

elif(exp >= 10 and exp < 15):

    ns = sal * 1.50

elif(exp >= 5 and exp < 10):

    ns = sal * 1.40

else:

    ns = sal * 1.25

print("Net Salary:", ns)

No comments:

Post a Comment

How to Fight Overthinking or Negative Thoughts?

How to Combat Overthinking or Negative Thoughts? 1. Don’t Fight Your Thoughts Trying to suppress or control negative thoughts often backfire...