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
reqeustslooks likerequestsrequestsitself is fine- An unrelated name is not flagged
numpyyis flagged- 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.