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

Struggling to Meditate? Try This Simple 1–100 Method (5 Minutes)

 Hi, so today we are going to discuss how to meditate easily in your daily life. Um, so it's like very simple but effective method that ...