Skip to content

Instantly share code, notes, and snippets.

@offby1
Created October 22, 2017 21:59
Show Gist options
  • Save offby1/b360b5ec5e5a555f7f652ba9cd3bf84e to your computer and use it in GitHub Desktop.
Save offby1/b360b5ec5e5a555f7f652ba9cd3bf84e to your computer and use it in GitHub Desktop.
import random
def get_locations(cell):
return (random.sample(cell,x),
random.sample(cell,x),
random.sample(cell,x))
# or the way I'd really write it
def get_locations(cell):
return ((random.sample(cell,x)) for _ in range(3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment