vendredi 10 juin 2016

Assigning 2 random teams out of 16 per person out of 8 people

I am trying to assign two random teams out of 16 to a random person out of 8 for a draw for the euros

Here is what i have:

import random

person = ['Ashton', 'Danny', 'Martin', 'Yves', 'Nick', 'Cormac', 'Thierry', 'Ciaran']

team = ['France', 'Switzerland', 'England', 'Slovakia', 'Germany', 'Ukraine', 'Spain', 'Czech Republic', 'Croatia', 'Italy', 'Republic of Ireland', 'Sweden', 'Russia', 'Wales', 'Belgium']

namesTeams = {}

for x in person:

teamName = team[random.randint(0, len(team) -1)]
namesTeams[x] = teamName
team.remove(teamName)

print(namesTeams)




Aucun commentaire:

Enregistrer un commentaire