Find employees eligible for bonus based on years served

In this python if else program, we will find the employees eligible for bonus within a company based on years served.

Condition for eligibility:
If an employee has served more or equal to 5 years in the company then only an employee is eligible for bonus.

Steps to solve the program
  1. Take years served within a company by an employee as input.
  2. Use an if-else statement to check the eligibility of an employee.
  3. Use the criteria given in the question.
  4. Print the respective output.
				
					exp = float(input("Enter years served"))

if exp > 4:
    print("You are eligible for bonus")
else:
    print("Your are not eligible for bonus")
				
			

Output :

				
					Enter years served: 5
You are eligible for bonus
				
			

Related Articles

find out given input belongs to which group

check if the input shape is square or not

Leave a Comment