Q. Which Python keyword is used to create a generator?

  • (A) yield
  • (B) return
  • (C) generate
  • (D) gen
πŸ’¬ Discuss
βœ… Correct Answer: (A) yield
Explanation: `yield` is used inside functions to return a generator object.
Explanation by: Mr. Dubey
`yield` is used inside functions to return a generator object.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
76
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
96%
Success Rate