1. Learn
  2. /
  3. Courses
  4. /
  5. Practicing Coding Interview Questions in Python

Connected

Exercise

The filter() function

Let's do some filtering! You will be given three corresponding tasks you have to complete. Use lambda expressions! And remember: the filter() function keeps all the elements that are mapped to the True value.

The variables nums, string and spells are available in your workspace.

Instructions 1/3

undefined XP
  • 1

    Exclude all the numbers from nums divisible by 3 or 5.

  • 2

    Return the string without its vowels ('y' is not a vowel in this case).

  • 3

    Filter (keep) all the spells in spells with more than two 'a' characters.