Question
Exercise 7: Program exercise for Basic List operations Write a complete Python program including minimal comments (file name, your name, and problem description) that solves
Exercise 7: Program exercise for Basic List operations
Write a complete Python program including minimal comments (file name, your name, and problem description) that solves the following problem with the main function:
Problem Specification:
Write a program that reads a number of scores from the user and performs the following:
Read scores from the user until the user enters nothing but key
Store scores into a list for processing below
Find the average of the scores along with the number of scores read (format as shown).
Sort the scores in ascending order and
Reverses the scores so that the scores are highest to the lowest.
Print the score with the ranking starting with 1.
Make sure you have a main function and there should not be any global variable or statement other than the main function that is being called.
Sample RUN #1: enter a score: 95 enter a score: 65 enter a score: 77 enter a score: 67 enter a score: 88 enter a score: 98 enter a score: 84 enter a score: All scores stored: [95, 65, 77, 67, 88, 98, 84] There are 7 scores entered The average is 82.00 After sorting in ascending order: [65, 67, 77, 84, 88, 95, 98] rank: score 1 : 98 2 : 95 3 : 88 4 : 84 5 : 77 6 : 67 7 : 65 SAMPLE RUN #2: enter a score: 89 enter a score: 97 enter a score: 77 enter a score: All scores stored: [89, 97, 77] There are 3 scores entered The average is 87.67 After sorting in ascending order: [77, 89, 97] rank: score 1 : 97 2 : 89 3 : 77 SAMPLE RUN #3: enter a score: All scores stored: [] No scores enteredExercise 7: Program exercise for Basic List operations Write a complete Python program including minimal comments (fie name, your name, and problem description) that solves the following problem with the main function Problem Specification: Write a program that reads a number of scores from the user and performs the following 1. Read scores from the user until the user enters nothing but key 2. Store scores into a list for processing below 3. Find the average of the scores along with the number of scores read (format as shown). 4. Sort the scores in ascending order and 5. Reverses the scores so that the scores are highest to the lowest. 6. Print the score with the ranking starting with 1 Make sure you have a main function and there should not be any gobal variable or statement other than the main function that is being called. Sample RUN #1: enter a score: 95 enter a score: 65 enter a score: 77 enter a score: 67 enter a score: 88 enter a score: 98 enter a score: 84 enter a Score: All scores stored: [95, 65, 77, 67, 88, 98, 84 There are 7 scores entered The average is 82.00 After sorting in ascending order [65, 67, 77, 84, 88, 95, 98] rank: score 1:98 2 95 388 484 5:77 667 765 SAMPLE RUN #2: enter a score: 89 enter a score: 97 enter a score: 77 enter a score: All scores stored [89, 97, 77] There are 3 scores entered The average is 87.67 After sorting in ascending order: [77, 89, 97] rank: score 1:97 2 :89 3 :77 SAMPLE RUN #3: enter a score: All scores stored: [ No scores entered
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started