222k views
5 votes
What does the following program do? student = 1 while student <= 3: total = 0 for score in range (1,4): score = int(input("Enter test score: ")) total += score average = total/3 print("Student ", student, "average: ", average) student += 1

1 Answer

6 votes

Answer:

The code requests for the scores of three students for three courses offered by each student.

It calculates and print the average score for each student

Step-by-step explanation:

The code written in Python programming language uses a while to get student 1-3 and a for loop to get scores for course 1-3

See attached code and output

What does the following program do? student = 1 while student <= 3: total = 0 for-example-1
User FalconNL
by
5.5k points