Which of the following is the correct way to write a generator which will output the numbers between 1 and 100 (inclusive)?
Answer
Correct Answer: def onehundred(start, end): current = start while current <= end: yield current current += 1 for x in onehundred(1, 100): print x
Explanation:
Note: This Question is unanswered, help us to find answer for this one