Skip to content

Instantly share code, notes, and snippets.

@cmtsij
Created October 20, 2016 13:24
Show Gist options
  • Save cmtsij/c820652962f925e88cd1c6bb3cd1438b to your computer and use it in GitHub Desktop.
Save cmtsij/c820652962f925e88cd1c6bb3cd1438b to your computer and use it in GitHub Desktop.
Taiwan lottery
#!/usr/bin/env python
import random
l=range(1,1+49)
random.shuffle(l)
# extend 5 numbers. (49->54)
l.extend(random.sample(l[0:48],5))
# display
for i in xrange(9):
x=l[6*i:6*i+6]
x.sort()
print x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment