import random


def open_goat(experiment_result, choice):
    """
    Returns index of goat except user choice.
    """
    while True:
        potential_goat = random.randrange(3)
        if potential_goat == choice:
            continue
        if experiment_result[potential_goat]:
            # It is not goat actually
            continue
        return potential_goat