HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Quizzes
  2. /A list comprehension uses a conditional expression, and filter is called with None. What does the program print?
Python ProgrammingHardHigh School (11–12)Python Going Further › Comprehensions, Iterators and GeneratorsPCAP (Python Institute)
StemPy LabCreated by StemPy Lab

A list comprehension uses a conditional expression, and filter is called with None. vals = [x if x % 3 else 0 for x in range(1, 7)] print(vals, list(filter(None, vals))) What does the program print?

Log in to save
← All Quizzes
← A function returns a lambda that remembers the number it was made with. What does the program print?Each option makes a small anonymous function with lambda, and most of them also call it at once. Which options have the value 6, a plain integer? Choose every correct option. →
More onPython Going Further › Comprehensions, Iterators and Generators

Discussion (0)

Log in to join the discussion.

Loading…

More questions on this topic

  1. Two generator functions work one after the other on a shopping list. What does the program print?Hard
  2. A generator function gives the capital letters of a text, as small letters. What does the program…Hard
  3. A list comprehension and a lambda work on the words of a sentence. What does the program print?Medium
  4. A generator function gives the characters of a text up to a stop character, and then ends with…Medium
  5. A generator expression is tested with in, and then turned into a list. What does the program print?Hard
All questions on this topic →

Problems on this topic

  1. Write an endless generator primes() that gives 2, 3, 5, 7, 11,..…Hard
  2. Write an endless generator squares() that gives 1, 4, 9, 16,..…Medium
  3. Follow the generatorMedium
  4. Used upMedium
All problems on this topic →