What is the output of: print(list(map(lambda x: x**2, filter(lambda x: x % 2 == 0, range(6)))))?

Python Developer Medium

Python Developer — Medium

What is the output of: print(list(map(lambda x: x**2, filter(lambda x: x % 2 == 0, range(6)))))?

Key points

  • The filter function selects even numbers from the range.
  • The map function squares each number.
  • The output is a list of squared even numbers.

Ready to go further?

Related questions