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
- Take years served within a company by an employee as input.
- Use an if-else statement to check the eligibility of an employee.
- Use the criteria given in the question.
- 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