Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
NBA Stats Application
The Helper Function
Core Functions
Menu Functions
14. Menu option – show top player in a club
Putting it all together

Instruction

That's right! Now, we'll focus on a function which will show clubs' top players.

Exercise

Create a function named show_top_player_in_club(players, clubs). The function should:

  1. Get a club from the user. Use the get_club_index(clubs) function.
  2. Get a parameter from the user. Use the get_param_from_user() function.
  3. Print the best player in the given club, based on the given parameter. Use the find_best_in_club(players, club, user_param) and print_player(player) functions.

You can re-use the functions you created previously.

Stuck? Here's a hint!

Add one to the user choice to get the actual tuple index you need:

user_choice = get_param_from_user() + 1

You can get a club name in a following way:

clubs[club_index]