-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3rd_solution.py
More file actions
39 lines (24 loc) · 798 Bytes
/
Copy path3rd_solution.py
File metadata and controls
39 lines (24 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""3. Student Result Checker
Write a Python program to check whether a student has passed or failed. A student is considered passed if they score at least 40% overall and 33% in each subject. Assume marks for 3 subjects as input.
Sample Input:
Enter marks for Subject 1: 35
Enter marks for Subject 2: 42
Enter marks for Subject 3: 50
Sample Output:
Result: Passed, 42.33%
"""
sub1 = 34
sub2 = 42
sub3 = 100
avg = (sub1+sub2+sub3)/3
if(avg >=40 and sub1 >=33 and sub2 >= 33 and sub3>=33):
# print("Result: Passed, ", avg)
print(f"Result: Passed, {avg}")
else:
print("Result: Failed")
# not for the exam just for understand the code
# if(avg >=40):
# if(sub1 >=33):
# if(sub2 >= 33):
# if(sub3>=33):
# print("pass"):