import random

goat1 = random.randint(1, 3)
goat2 = random.randint(1, 3)

while goat1 == goat2:
    goat2 = random.randint(1, 3)


success = 0
tries = 1_000_000
for _ in range(tries):
    options = [1, 2, 3]
    choice = random.randint(1, 3)
    options.remove(choice)
    if choice == goat1:
        options.remove(goat2)
    else:
        options.remove(goat1)

    choice = options[0]

    if choice != goat1 and choice != goat2:
        success = success + 1

print(success / tries)

[((3, 8, 3, 28), 'random.randint', 'random.randint', ({(3, 23, 3, 24): '1', (3, 26, 3, 27): '3'}, {}), '(1, 3)', False, 'import random\n'), ((4, 8, 4, 28), 'random.randint', 'random.randint', ({(4, 23, 4, 24): '1', (4, 26, 4, 27): '3'}, {}), '(1, 3)', False, 'import random\n'), ((7, 12, 7, 32), 'random.randint', 'random.randint', ({(7, 27, 7, 28): '1', (7, 30, 7, 31): '3'}, {}), '(1, 3)', False, 'import random\n'), ((14, 13, 14, 33), 'random.randint', 'random.randint', ({(14, 28, 14, 29): '1', (14, 31, 14, 32): '3'}, {}), '(1, 3)', False, 'import random\n')]