Make it shorter

Report a typo

Rewrite the for-loop inside the generator into a single line, using the yield from expression. You should write only that one line.

def generator(data):
    for i in list(data):
        yield i
Enter a short text
___

Create a free account to access the full topic