Get startedGet started for free

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.

This exercise is part of the course

Writing Efficient Python Code

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Convert Brock's Pokédex to a set
brock_pokedex_set = ____
print(brock_pokedex_set)
Edit and Run Code