To pause and resume a generator function, the _________ keyword is used within the function body.

  • yield
  • await
  • pause
  • resume
In a generator function, the yield keyword is used to pause and resume the function's execution. It allows the generator to produce a sequence of values over time. The other options are not relevant to the purpose of pausing and resuming a generator.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *