The Full Wiki

More info on Generator (computer science)

Generator (computer science): Quiz


Question 1: In short, a generator looks like a function but behaves like an ________.
Associative arrayC (programming language)IteratorJava (programming language)

Question 2: Python has a syntax modelled on that of ________, called a generator expression that aids in the creation of generators.
Python (programming language)List comprehensionFilter (higher-order function)Map (higher-order function)

Question 3: Java does not have ________ functionality out of the box, but generators can be implemented using threading.
ContinuationCoroutinePython (programming language)Control flow

Question 4: In ________, a generator is a special routine that can be used to control the iteration behaviour of a loop.
Computer scienceProgramming paradigmComputer programmingSoftware engineering

Question 5: In Python, a generator can be thought of as an iterator that contains a frozen ________.
Programming languageSubroutineAssembly languageCall stack

Question 6: Generators can be implemented in terms of more expressive control flow constructs, such as coroutines or first-class ________.
Python (programming language)SmalltalkContinuationScheme (programming language)


Got something to say? Make a comment.
Your name
Your email address