MCQs > IT & Programming > Python > Which of these functions is a generator that will produce an endless sequence of odd numbers?

Python MCQs

Which of these functions is a generator that will produce an endless sequence of odd numbers?

Answer

Correct Answer: def odds(): value = 1 while True: yield value value += 2

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it