(hint: first define an empty list, and then through the for loop, element is added to the list to score in turn until the end of the five judges score all input loop, and then removed from the list with the maximum and minimum values, and finally by the sum () function sum and divided by the average number of elements,)
Requirements: (1) the use of combination type of operating functions and data processing method to complete the programming;
(2) the program needs to add annotations, indicating the functions of each line of code: Complete code of the program and its result upload screenshots,
CodePudding user response:
Arr=[]For I in range (5) :
Arr. Append (int (input (" % s judges scoring: "% (I + 1)))) # cycle entry score
Arr. The sort order of the fraction () #
Print (" player final score: % 2 f "% (sum (arr (1:4))/(3)) # remove the highest and lowest points, calculate the average