avatar Bite 189. Filter a list of names

Here is a Bite to practice the continue and break statements in Python.

Complete filter_names that takes a list of names and returns a filtered list (or generator) of names using the following conditions:

  1. names that start with IGNORE_CHAR are ignored,
  2. names that have one or more digits are ignored,
  3. if a name starts with QUIT_CHAR it inmediately exits the loop, so no more names are added/generated at this point (neither the QUIT_CHAR name),
  4. return up till MAX_NAMES names max.

Good luck and keep calm and code in Python!

Login and get coding
go back Beginner level
Bitecoin 2X

384 out of 387 users completed this Bite.
Will you be Pythonista #385 to crack this Bite?
Resolution time: ~35 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 2.14 on a 1-10 difficulty scale.
» You can do it! 😌

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help