Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Groups
Community ▾
A
A
What does the word yield do in a function? | StemPy Lab
Quizzes
/
What does the word yield do in a function?
Python Programming
Medium
High School (11–12)
High School (9–10)
Undergraduate
General
Python Going Further › Comprehensions, Iterators and Generators
Created by
StemPy Lab
What does the word yield do in a function?
It makes the function run twice
It gives a value and pauses the function, so that it can continue later
It ends the function and gives a value
It prints a value
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← What does a for loop call to get an iterator from a list?
g = (n * n for n in range(4)). What do list(g) and then list(g) again give? →
More on
Python Going Further › Comprehensions, Iterators and Generators
Discussion (0)
Log in
to join the discussion.
Loading…
Problems on this topic
Write an endless generator primes() that gives 2, 3, 5, 7, 11,...
Hard
Write an endless generator squares() that gives 1, 4, 9, 16,...
Medium
Follow the generator
Medium
Used up
Medium
All problems on this topic →