Command Palette

Search for a command to run...

Hectal
Phase 6: Modules, Packages and Projects
Python · Exercise 5 of 5 Previous
Intermediate

Flag look-alike package names

Write is_lookalike(name, popular) that returns True when name is not in the list popular but is very close to one of its entries, using difflib.get_close_matches with cutoff=0.8.

A name that is exactly in popular returns False, and so does a name that is not close to anything.

What Check tests

  1. reqeusts looks like requests
  2. requests itself is fine
  3. An unrelated name is not flagged
  4. numpyy is flagged
  5. An empty popular list flags nothing

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

main.py
Sign in to run your code.

Output

Press Run to see what your program prints.