Skip to content

Instantly share code, notes, and snippets.

@markdcummings
Last active November 14, 2016 23:05
Show Gist options
  • Save markdcummings/1b1c7408a76b896492b5fcb432dcb8e8 to your computer and use it in GitHub Desktop.
Save markdcummings/1b1c7408a76b896492b5fcb432dcb8e8 to your computer and use it in GitHub Desktop.
import random
players = ['Garry', 'Joanna', 'Sara', 'Mark', 'Phil', 'Tom']
houses = ['Stark', 'Greyjoy', 'Dorne', 'Tyrell', 'Lannister', 'Baratheon']
random.shuffle(houses)
for (player, house) in zip(players, houses):
print('%(player)s is assigned house %(house)s' %
{'player': player, 'house': house})
@garrypolley
Copy link

This is much better. I didn't think to use zip. I like it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment