One more generator

Report a typo

There is a code with a generator that generates numbers within a certain range and then prints these numbers on separate lines, but the code is in the wrong order. Arrange it in the correct way and add indents where necessary. Please, use examples from the theory as a reference.

Use the arrows on the right to move lines up and down, and the buttons on the left to add indentation (one click equals four spaces).

Reorder lines using drag or arrows. Adjust indentation with left buttons
                def gen():
              
                for i in gen():
              
                yield from range(10)
              
                print(i)
              
___

Create a free account to access the full topic