-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathMidterm_Review_Q1.py
25 lines (25 loc) · 1.1 KB
/
Midterm_Review_Q1.py
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
# One of your colleagues has written the following functions.
# Get_Score(user_name)
# which returns a test score for the user user_name.
# and
#
# Get_average(total, number_of_students)
# which returns the average of all the scores.
# They have saved these functions in a file named scores.py.
# Using these two functions, write a function main() that does the following
#
# Assuming that there are 100 students in the class, use For Loop to
# 1.1 Ask user to enter their name
# 1.2 Use the Get_score(user_name)function to get the user’s score
# Calculate the total score
# Calculate the test score average by using the function Get_average(total, number_of_students) function
# Note: You are required to use the two functions that your colleague has written to perform the tasks of getting
# user inputs and calculating the total. Do not define these functions again.
# Without comments, your program should be no longer than 7-8 lines
import scores
num_students=100
total=0
for i in range(num_students):
name=input("Enter your name \n")
total+=scores.Get_score(name)
average=scores.Get_average(total,num_students)