Basic Programs

If Else Programs

While loop Programs

For loop Programs

List Programs


Python Program to Check Whether a Student is Pass or Fail


In this example shows, how to check whether a student is pass or fail, with condition and display the output.

Steps
  1. The program gets the 5 marks as an input.
  2. Wheather the given marks are greater than or equal to 35, the result is Pass. Otherwise, the Result is fail.
Here the example, to check the given integer value is pass or fail using if,else statement.
Example.py
subject1 = int(input('Enter the Mark:'))
subject2 = int(input('Enter the Mark:'))
subject3 = int(input('Enter the Mark:'))
subject4 = int(input('Enter the Mark:'))
subject5 = int(input('Enter the Mark:'))

if(subject1>=35 and subject2>=35 and subject3>=35 and subject4>=35 and subject5>=35):
    print('Pass')
else:
    print('Fail')

Output

Enter the subject1 Mark:56
Enter the subject2 Mark:98
Enter the subject3 Mark:67
Enter the subject4 Mark:69
Enter the subject5 Mark:89

Pass

Prev Next