[Solved] Could you check this out to tell me what it tries to teach by answering three questions about the given code? (Python)
1) "reverse is not defined"? ( I guess it was supposed to be putNumbers(100), down there) 2) Why is the word class picked here, why does the func name look like a class name, too? 3) There are easier ways to do this, so what harder case do you think this is an example of? What's the point? "Question: Define a class with a generator which can iterate the numbers, which are divisible by 7, between a given range 0 and n. Hints: Consider use yield Solution: def putNumbers(n): i = 0 while i<n: j=i i=i+1 if j%7==0: yield j for i in reverse(100): print(i) " Taken from : https://github.com/zhiwehu/JUMP_LINK__&&__Python__&&__JUMP_LINK-programming-exercises/blob/master/100%2B%20Python%20challenging%20programming%20exercises%20for%20Python%203.md#question-20 Thanks a bunch.