Eligibility Criteria - 4
Given a student has scored M marks in Maths, P marks in Physics and C
marks in Chemistry. Write a program to check if a student is eligible for admission in a professional course. If any one of the below conditions is satisfied then the student is eligible.
1) M >= 60, P >= 50, C >= 45 and M + P + C >= 180.
2) Total in M and P >= 120 or Total in C and P >= 110.
The first line is an integer M
The second line is an integer p
The third line is an integer C
The output should be a single line containing True , if it satisfies the given conditions, False in all other cases
Given M = 72, P = 65, C = 51 , the scores of this student satisfies the first condition
M >= 60, (72 >= 60)
P >= 50 (65 >= 50)
C >= 45 (51 >= 45)
M + P + C >= 180 (72 + 65 + 51 >= 180)
So, the student is eligible.
Sample Input 1
72
65
51
Sample Output 1
True
Sample Input 2
70
70
Sample Output 2
False
Sample Input 3
60
60
40
Sample Output 3
True
M = int(input())
P = int(input())
C = int(input())
MP = M + P
MC = M + C
PC = P + C
MPC=M+P+C
if( M >= 60 and P >= 50 and C >= 45 and MPC>=180) or (MP >= 120 or PC >= 110):
print('True')
else:
print('False')
Comments
Leave a comment