What does `yield` do inside a function?
Answer & explanation
Answer: Produces a value and suspends the generator
`yield` produces a value while preserving generator state for the next iteration.
Practice generators with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
Answer: Produces a value and suspends the generator
`yield` produces a value while preserving generator state for the next iteration.