Skip to content

Instantly share code, notes, and snippets.

@spratt
Created May 19, 2013 03:55
Show Gist options
  • Save spratt/5606614 to your computer and use it in GitHub Desktop.
Save spratt/5606614 to your computer and use it in GitHub Desktop.
Randomly select 12 words from input words specified one word per line
#!/usr/bin/env python2.7
import random
from sys import stdin
words = []
for line in stdin:
words.append(line.strip())
print(random.sample(words,12))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment