In this python if else program, we will check the student’s eligibility to attend the exam based on his/her attendance.
Steps to solve the program
- Take a student’s attendance % as input through the user.
- Using an if-else statement check the student’s eligibility to attend the exam.
- If the attendance is greater than or equal to 75 then the student is eligible, else the student is not eligible.
- Print the respective output.
attendance = int(input("Enter attendance % of a student: "))
if attendance >= 75:
print("Student is eligible")
else:
print("Student is not eligible")
Output :
Enter attendance % of a student: 78
Student is eligible