Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import sys
- # Word Count Example
- # input comes from standard input STDIN
- for line in sys.stdin:
- # remove leading and trailing whitespaces
- line = line.strip()
- # split the line into words and returns as a list
- words = line.split()
- for word in words:
- # write the results to standard output STDOUT
- # Emit the word
- print'%s\t%s' % (word, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement