Exercises
The following exercises provide you with the opportunity to practice with optimizing your code. The solutions to these exercises are found in the section Chapter 20.
-
You’re working on software that analyzes sports players. Following are two arrays of players of different sports:
basketball_players = [ {first_name: "Jill", last_name: "Huang", team: "Gators"}, {first_name: "Janko", last_name: "Barton", team: "Sharks"}, {first_name: "Wanda", last_name: "Vakulskas", team: "Sharks"}, {first_name: "Jill", last_name: "Moloney", team: "Gators"}, {first_name: "Luuk", last_name: "Watkins", team: "Gators"} ] football_players = [ {first_name: "Hanzla", last_name: "Radosti", team: "32ers"}, {first_name: "Tina", last_name: "Watkins", ...
Get A Common-Sense Guide to Data Structures and Algorithms in Python, Volume 1 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.