Question: Prompt the user to enter an integer between 3 and 20. This will be the number of grades we will average. Use a while loop

Prompt the user to enter an integer between 3 and 20. This will be the number of grades we will average.

Use a while loop to make sure the input is good. I.e., if I enter a letter, float, or integer outside that range, ask me to try again until I enter a good number. Hint: initialize a sentinel value before the loop, and a try and except block inside the loop.)

Use a for loop and the randint function to get the number of integers requested. Print out each one, and it's letter grade. Your letter grade function from the last assignment shouldn't have to be modified here.

Average them. (Hint: You haven't been taught how to create an unknown number of variables, so I don't expect you to create grade1, grade2, etc. Just get a new grade each time through the loop, print it, and add it to a running total. When the loop is done, you should have a total of all of the grades, and simply divide that by the number of grades to get an average.)

Print the average and its letter grade.

Using Python Language

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!