Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #!/usr/bin/python
  2. import sys
  3. # Word Count Example
  4. # input comes from standard input STDIN
  5. for line in sys.stdin:
  6. # remove leading and trailing whitespaces
  7. line = line.strip()
  8. # split the line into words and returns as a list
  9. words = line.split()
  10. for word in words:
  11. # write the results to standard output STDOUT
  12. # Emit the word
  13. print'%s\t%s' % (word, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement