omega-rosetta
aien-dev/omega-rosetta
Brought by drakestapleton
omega-rosetta / tasks / reverse-words-in-a-string / oracle.py
| 1 | # Independent reference for "Reverse words in a string" (Python 3, standard library only). |
| 2 | # expected.txt is this program's stdout; omc never produced it. |
| 3 | lines = ['---------- Ice and Fire ------------', '', 'fire, in end will world the say Some', 'ice. in say Some', "desire of tasted I've what From", 'fire. favor who those with hold I', '', '... elided paragraph last ...', '', 'Frost Robert -----------------------'] |
| 4 | for line in lines: |
| 5 | print(" ".join(reversed(line.split()))) |