-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolution9.py
More file actions
30 lines (25 loc) · 960 Bytes
/
solution9.py
File metadata and controls
30 lines (25 loc) · 960 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
"""
ex.9
The exercise is almost identical to a previous exercise with a minor change. It's the end of the semester and you got your marks from, Geometry, Algebra,
Physics classes. If the average score is 7 and above print "Good job!", if the average score is between 6 and 4 print "You need to work harder!",
if the average score is below 4 print "Failed, you really need to work harder!".
Create a program that:
* Reads the values of these 3 lessons
* Calculate the average of your grades
* Example: Geometry = 6, Algebra = 7, Physics = 8
* Output: Your average score is 7, Good job!"
"""
def subjects_scores(geometry, algebra, physics):
sum1 = geometry + algebra + physics
average = sum1/3
return average
geo = 6
alg = 2
phy = 3
avg_score = subjects_scores(geo, alg, phy)
if avg_score >= 7:
print("Good job!")
elif 6 >= avg_score >= 4:
print("You need to work harder!")
else:
print("Failed, you really need to work harder!")