Question: Python Programming: How do I solve part D using all_scores = [j_list[:], k_list[:], c_list[:]] to add 1 extra point to every score of every skater

Python Programming:

How do I solve part D using all_scores = [j_list[:], k_list[:], c_list[:]] to add 1 extra point to every score of every skater with a nested for loop?

Three figure skaters, Jean, Kayla and Connie, compete in a meet. Each skater receives 4 scores. Write a program to do the following.

(a) Ask the user to enter 4 scores for Jean. Store the scores in a list named j_list. Display the list.

(b) Ask the user to enter 4 scores for Kayla. Store the scores in a list named k_list. Display the list. (

c) Ask the user to enter 4 scores for Connie. Store the scores in a list named c_list. Display the list.

(d) First, use the following code to create a copy of each list and construct a list of lists from them:

all_scores = [j_list[:], k_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 = [j_list, k_list, c_list]

Next, use a set of nested for loops to add 1 extra point to every score of every skater in all_scores. Display all_scores.

(e) Sort the scores in ascending order within each skater in all_scores. Display all_scores.

The following is an example. Please enter Jean's scores one by one. Enter a score: 77 Enter a score: 74 Enter a score: 75 Enter a score: 72 Jean's scores: [77.0, 74.0, 75.0, 72.0] Please enter Kayla's scores one by one. Enter a score: 81 Enter a score: 77 Enter a score: 80 Enter a score: 79 Kayla's scores: [81.0, 77.0, 80.0, 79.0] Please enter Connie's scores one by one. Enter a score: 69 Enter a score: 74 Enter a score: 72 Enter a score: 70 Connie's scores: [69.0, 74.0, 72.0, 70.0] All scores: [[77.0, 74.0, 75.0, 72.0], [81.0, 77.0, 80.0, 79.0], [69.0, 74.0, 72.0, 70.0]] All scores after extra point: [[78.0, 75.0, 76.0, 73.0], [82.0, 78.0, 81.0, 80.0], [70.0, 75.0, 73.0, 71.0]] All scores after sorting: [[73.0, 75.0, 76.0, 78.0], [78.0, 80.0, 81.0, 82.0], [70.0, 71.0, 73.0, 75.0]]

Here is what I have so far, but line 24 and beyond is not giving me the scores after extra point. I'v bolded what I need help on below:

j_list = [] k_list = [] c_list = [] print("Please enter Jean's scores one by one.") for i in range(4): ent_j_list_scores = float(input("Enter a score: ")) j_list.append(ent_j_list_scores) print("Jean's scores: ", j_list) print(" Please enter Kayla's scores one by one.") for i in range(4): ent_k_list_scores = float(input("Enter a score: ")) k_list.append(ent_k_list_scores) print("Kayla's scores: ", k_list) print(" Please enter Connie's scores one by one.") for i in range(4): ent_c_list_scores = float(input("Enter a score: ")) c_list.append(ent_c_list_scores) print("Connie's scores: ", c_list) all_scores = [j_list[:], k_list[:], c_list[:]] print('All scores: ', all_scores) for i in range(len(all_scores)): j_list[i] = j_list[i] + 1 k_list[i] = k_list[i] + 1 c_list[i] = c_list[i] + 1 all_scores.append(j_list) all_scores.append(k_list) all_scores.append(c_list) print("All scores after extra point: ", all_scores) all_scores.sort() print("All scores after sorting: ", all_scores) 

Thank you for assistance!

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!