Question: Midterm practice question 2 This is a list within a list problem. Write a Python program to do the following: Calculate the average for a

Midterm practice question 2
This is a list within a list problem. Write a Python program to do the following:
Calculate the average for a list of numbers
Use a for loop to iterate through the weekly_sales list, and calculate the average sales number and print the name of the sales person followed by the average.
Here is the sales summary to use as input:
weekly_sales
['John Sellall', [10000,9250,1900,8009,8059,7500]],
['Sarah Marketer', [9990,9120,6100,10000,8500,9900]],
['Frank Deal', [7500,7055,10000,8020,8500,9100]],
['Bill Discount', [9500,7000,1100,8500,9000,7050]'],
['Betty Budget', '[10000,10000,11100,12000,10000,9900,
['Charles Closing', [8800,8500,8370,9000,7900,9100]]]
John Sellall 7453
Sarah Marketer 8935
Frank Deal 8362
Billl Discount 7025
Betty Budget 10500
Charles Closing 8612
Basically all you need is a for loop that loops through weekly_sales, gets the average and prints the name and the average. You can use sum, len, and round to do that.
 Midterm practice question 2 This is a list within a list

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!