News for hackers. Stuff that matters.
Re:The Yoda of Silicon Valley by mkesper on Tuesday December 18, 2018 @11:27AM (#18707817)
You don't want to read all input into memory first.
Re:The Yoda of Silicon Valley by mkl on Tuesday December 18, 2018 @03:02PM (#18710013)
Fair enough.

  import re
  import sys
  import collections
  
  c = collections.Counter()
  for line in sys.stdin:
      words = re.findall('[a-z]+', line.lower())
      c.update(words)
  for word, count in c.most_common(int(sys.argv[1])):
      print(f'{count:>7} {word}')