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
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 weeklysales 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:
weeklysales
John Sellall',
Sarah Marketer',
Frank Deal',
Bill Discount',
Betty Budget',
Charles Closing',
John Sellall
Sarah Marketer
Frank Deal
Billl Discount
Betty Budget
Charles Closing
Basically all you need is a for loop that loops through weeklysales, gets the average and prints the name and the average. You can use sum, len, and round to do that.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
