Skip to content
CodeKruPro

map, filter and reduce in Python 3

QuizMediumPython onlyAsked in: TCS

Which statements are true for Python 3.12? Pick all that apply.

  • map(str, [1, 2]) returns a lazy map object, not a list
  • After list(m), calling list(m) again on the same map gives the values again
  • reduce must be imported from functools
  • list(filter(None, [0, 1, 2])) is [1, 2]

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in