M

Mr. Dubey • 100.28K Points
Coach

Q. Which keyword is used to define a generator in Python?

  • (A) def
  • (B) gen
  • (C) yield
  • (D) return
  • Correct Answer - Option(C)
  • Views: 14
  • Filed under category Python

Explanation by: Mr. Dubey
`yield` is used to define a generator and return a value from it.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics