# How do we select a team of 6 students for a quidditch team?
# mixing Gryffindors and Slytherins??



import random

Gryffindor = ["Harry", "Ron", "Hermione", "Fred", "George"]
Slytherin  = ["Draco", "Crabbe", "Goyle", "Snape", "Zabini"]

# SOLUTION 1
QuidditchTeam = []
pool = Gryffindor + Slytherin
while len(QuidditchTeam) < 6:
    pick = random.choice(pool)
    if pick not in QuidditchTeam:
        QuidditchTeam.append(pick)

print ("solution 1 quidditch team: ", QuidditchTeam)

# SOLUTION 2
QuidditchTeam = []
pool = Gryffindor + Slytherin
for i in range(6):
    pick = random.choice(pool)
    pool.remove(pick)
    QuidditchTeam.append(pick)

print ("solution 2 quidditch team: ", QuidditchTeam)

# SOLUTION 3
QuidditchTeam = []
pool = Gryffindor + Slytherin
random.shuffle(pool)
for i in range(6):
    QuidditchTeam.append(pool.pop())

print ("solution 3 quidditch team: ", QuidditchTeam)

# SOLUTION 4
QuidditchTeam = []
while len(QuidditchTeam) < 6:
    source = random.choice([Gryffindor, Slytherin])
    pick = random.choice(source)
    if pick not in QuidditchTeam:
        QuidditchTeam.append(pick)

print ("solution 4 quidditch team: ", QuidditchTeam)

# SOLUTION 5
QuidditchTeam = []
pool = Gryffindor + Slytherin
while len(pool) != 6:
    pool.pop(random.randint(0,len(pool)-1))
QuidditchTeam = list(pool)

print ("solution 5 quidditch team: ", QuidditchTeam)

# SOLUTION 6
QuidditchTeam = []
pool = Gryffindor + Slytherin
while len(pool) != 6:
    pool.pop(random.choice(list(range(len(pool)))))
QuidditchTeam = list(pool)

print ("solution 6 quidditch team: ", QuidditchTeam)

choices = [0,1]
print ("random choice on two ints ", random.choice(choices))
print ("random choice on two ints ", random.choice(choices))
print ("random choice on two ints ", random.choice(choices))
