Question
# Python Please help me convert the input values to float values Code works, but the values printed need to be floats like 77.0 etc.
# Python Please help me convert the input values to float values Code works, but the values printed need to be floats like 77.0 etc. j_list = [] k_list = [] c_list = [] # Enter scores for Jean print("Please enter Jean's scores one by one. ") for i in range(4): j_list.append(eval(input())) print("Jeans scores:", j_list) # Enter scores for Kayla print("Please enter Kayla's scores one by one. ") for i in range(4): k_list.append(eval(input())) print("Kayla scores: ", k_list) # Enter scores for Connie print("Please enter Connie's scores one by one. ") for i in range(4): c_list.append(eval(input())) print("Connie scores: ", c_list) # merging everything to a single list
all_scores = [j_list, k_list, c_list] print("All scores", all_scores) # adding one to the scores of each skaters using nested list
for i in range(len(all_scores)): #loop for iterating through the main list for j in range(len(all_scores[i])): #loop for iterating through the sub list all_scores[i][j] += 1# adding 1 to scores print("All scores after extra point:", all_scores) # now we will sort the values in the same way as previous
for i in all_scores: i.sort() print("Scores after sorting:", all_scores) print(all_scores)
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