Skip to content

Instantly share code, notes, and snippets.

@renegarcia
Created July 15, 2023 07:19
Show Gist options
  • Save renegarcia/6d18c94aceb2532bba6b94e413cddf03 to your computer and use it in GitHub Desktop.
Save renegarcia/6d18c94aceb2532bba6b94e413cddf03 to your computer and use it in GitHub Desktop.
Reads from stdin and prints words one per line.
"""
words.py: Reads from stdin and prints words one per line.
"""
import fileinput
for line in fileinput.input():
for word in line.split():
print(word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment