import random, copy

def simulate_game():
    doors = range(3) #0, 1, 2
    car = random.choice(doors)
    
    contestant_selection = random.choice(doors)
    doors.remove(contestant_selection)
    
    monty_doors = copy.copy(doors)
    # Choices for Monty to open to reveal a goat
    
    try:
        monty_doors.remove(car) # Hall won't reveal a car
    except ValueError:
    # If user picked the car to start and therefore is already removed
        pass
    
    monty_goat_reveal = random.choice(monty_doors)
    doors.remove(monty_goat_reveal) # Remove Goat door
    
    switched_choice = doors.pop()
    
    return switched_choice == car
    
if __name__ == '__main__':
    counter = 0
    trials = 10000
    for x in xrange(trials):
        if simulate_game():
            counter += 1
    print 'Percentage won is: {}%'.format(100. * counter / trials)
    