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

Everyone Is Fighting a Battle You Can't See ❤️ | A Simple Reminder to Be Kind

 Hi, namaste Krishna. So today we will be talking about that everyone is going through something in their life. Be it you, be it your friend...