Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a Python program that prompts the user to enter grades to a list, alist (which is initially empty), and calculate the sum and average of

a Python program that prompts the user to enter grades to a list, alist (which is initially

empty), and calculate the sum and average of the entered grades. The user will continue

entering grades until he/she enters the sentinel value -1.

Notes:

- Grades are in the range from 0 to 20.

- the program should use the while loop to input the grades

- theprogram should print the final list, the sum, and the average (rounded to two figures).

- One of the grades should be the last digit of your ID +10. For example, if your ID

number is 020787521426, then one of the entered grades should be 16 (6+10)

the output :

image text in transcribed
In case no grades have been entered, the output should be: Enter grades to calculate their average, 1 to stop entry: 1 No grades have been entered! In case of entering some grades, the output should be: Enter grades to calculate their average, 1 to stop entry: 13 Enter another grade, 1 to finish: 12 Enter another grade, 1 to finish: 18 Enter another grade, 1 to finish: 1 [13, 12, 18] The Sum of the entered grades is: 43 The Average of the entered grades is: 14.33 'u-Vnoows bard\

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions