Question: Complete the python program in the cell below. We are defining a function print_top_pitcher that takes two list arguments: names_list and games_won_list . Assume both
Complete the python program in the cell below. We are defining a function print_top_pitcher that takes two list arguments: names_list and games_won_list. Assume both lists have the same length n.
Assume as well that names_list is a (string) list of players' names and games_won_list the corresponding (integer) list of the number of games each player won. In other words, the player whose name is names_list[i] won games_won_list[i] games, where 0 i n.
The function should find the player(s) who won the most games and print the name(s) of the player(s) together with the number of games won.
For example, print_top_pitcher(['John', 'Max', 'Jill'], [10,12,9]) should print (something like) Max won the most games: 12 while print_top_pitcher(names, games_won) should print Scherzer won the most games: 15 Kluber won the most games: 15 def print_top pitcher (names_list, games_won_list): # TO DO # Find the list of name (s) of the pitcher(s) who won the most games # and the number of games he (they won. Save these values to the variables # top pitcher and max_games, respectively. The given print statement should display # Scherzer won the most games: 15 # Kluber won the most games: 15 print()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
