Answer to Question #225387 in Python for sayyii

Question #225387

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.


Input

The first line is an integer M

The second line is an integer p

The third line is an integer C

Output

The output should be a single line containing True , if it satisfies the given conditions, False in all other cases

Explanation

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


1
Expert's answer
2021-08-12T16:28:18-0400
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')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS