Words generator

Report a typo

There is a code with a generator words(sentence) that allows to split the sentence into words and print it. However, 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
                yield from sentence.split()
              
                def words(sentence):
              
                print(sentence)
              
___

Create a free account to access the full topic