1. Lära sig
  2. /
  3. Courses
  4. /
  5. Writing Efficient Python Code

Connected

exercise

Searching for Pokémon

Two Pokémon trainers, Ash and Brock, have a collection of ten Pokémon each. Each trainer's Pokédex (their collection of Pokémon) has been loaded into your session as lists called ash_pokedex and brock_pokedex respectively.

You'd like to see if certain Pokémon are members of either Ash or Brock's Pokédex.

Let's compare using a set versus using a list when performing this membership testing.

Instruktioner 1 / 4

undefined XP
    1
    2
    3
    4
  • Convert Brock's Pokédex list (brock_pokedex) to a set called brock_pokedex_set.