A college instructor has three students, Ashley, Barb, and Carl, who are taking her class. Each student has taken either
This problem has been solved!
Do you need an answer to a question different from the above? Ask your question!
Question:
A college instructor has three students, Ashley, Barb, and Carl, who are taking her class. Each student has taken either 3 or 4 tests which have been graded.
Write a Python program that performs the following steps. Label each block of code that performs these steps with an appropriate comment (e.g. # Step a):
- Ask the user to enter 3 test scores for Ashley. Store the scores in a list named a_list. Display the list.
- NOTE: The test scores could be entered as floating point numbers.
- Ask the user to enter 4 test scores for Barb. Store the scores in a list named b_list. Display the list.
- Ask the user to enter 3 test scores for Carl. Store the scores in a list named c_list. Display the list.
- Use the following code to create a copy of each list and construct a list of lists from them:
all_scores = [a_list[:], b_list[:], c_list[:]]
- Note: We want the elements of all_scores to be a copy of the three score lists but not the three score lists themselves. Therefore, the following code does not generate what we want:
all_scores = [a_list, b_list, c_list] # DO NOT DO THIS!!
After creating the all_scores list, print that list.
Related Book For
Business Analytics Communicating With Numbers
ISBN: 9781260785005
1st Edition
Authors: Sanjiv Jaggia, Alison Kelly, Kevin Lertwachara, Leida Chen
View Solution
Create a free account to access the answer
Cannot find your solution?
Post a FREE question now and get an answer within minutes.
* Average response time.
Question Details
Chapter #
9- Supervised Data Mining: k-Nearest Neighbors and Naïve Bayes
Section: Case study
Problem: 1
Posted Date: September 11, 2023 06:46:22