Question: Python code: evaluate _ players ( players _ names, players _ scores, threshold ) : Description: You are provided with a one - dimensional list

Python code:
evaluate_players(players_names, players_scores, threshold):
Description: You are provided with a one-dimensional list of player names and a 2D list of their scores
based on pre-assessments conducted before the start of the competition, along with a passing score
threshold. Your function should search through each player's name and check if their total score is equal
to or greater than the threshold. If a player does not meet the threshold, their name should be removed
from the list.
Parameters: players_names (a list of strings) indicating players names. The list may be empty.
players_scores A two-dimensional list of player names (strings) and their scores on a preassessment step they have already taken. The pre-assessments are of variable length.
threshold (an integer) representing a passing score.
Assumptions: The names in player_names will always appear in player_scores. Some names in
player_scores might not be in player_names.
Restrictions: You may use range(), len(), del, .remove(),.pop() for this function.
You are not allowed to import anything. You are not allowed to use list slicing. str(), float(), int() are allowed in each function. You are not allowed to use any string method. You are not allowed to use sets and dictionaries.
Return value: None. The list players_names is modified in place.
Examples:
players_names =["Raul", "Pam", "Eva", "Ginny"]
players_scores =[["Raul",8,7,6,1],["Mike",0,0,0,0,2],["Pam",10,10,10],
["Eva",5,5,3],["Jane",1,2,3],["Ginny",10,18]]
threshold =25
evaluate_players (players_names, players_scores, threshold)
print(players_names)-->['Pam', 'Ginny']
players_names =["Raul","Pam","Eva","Ginny"]
players_scores =[["Jose",0,0,10],["Raul",10,0,10],["Pam",10,10,10],
["Julia",0,0,0],["Eva",5,10,5],["Ginny",10,10,9],["Rose",1,1,10]]
threshold =20
evaluate_players (players_names, players_scores, threshold)
print(players_names)__>['Raul', 'Pam', 'Eva', 'Ginny']
players_names =["Raul","Pam","Eva","Ginny"]
players_scores =[["Pam",1,1,1,1,1,1,1,1,1,0],["Eva",1,3],["Mike",0,0,
10],["Ginny",7],["Rose",20],["Raul",1,2,3,3,1],["Daniel",1,10]]
threshold =10
evaluate_players(players_names, players_scores, threshold)
5
print(players_names)-->['Raul']

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 Programming Questions!