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 generator function gives the capital letters of a text, as small letters. 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 generator function gives the capital letters of a text, as small letters. def capitals(text): for ch in text: if ch.isupper(): yield ch.lower() g = capitals("PyCharm IDE") first = next(g) rest = list(g) print(first, rest, list(g)) What does the program print?

Log in to save
← All Quizzes
← A program uses filter and map with two lambda functions on a list of codes. What does the program print?Two generator functions work one after the other on a shopping list. What does the program print? →
More onPython Going Further › Comprehensions, Iterators and Generators

Discussion (0)

Log in to join the discussion.

Loading…

More questions on this topic

  1. A list comprehension uses a conditional expression, and filter is called with None. What does the…Hard
  2. Two generator functions work one after the other on a shopping list. What does the program print?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 →