import numpy as np doors = [1, 2, 3] # goats are placed behind the following two doors goats = np.random.choice(doors, 2, False) participant_choice = int(input("Choose a door from 1 to 3: ")) if (participant_choice == goats[0]): print("The car is not behind door", goats[1]) goats = np.delete(goats, 1) else: print("The car is not behind door", goats[0]) goats = np.delete(goats, 0) change = input("Do you want to switch door (y/n):") if (change == "y" and participant_choice == goats): print("Congratulation, you got a car") elif (change == "y" and participant_choice != goats): print("Sorry, you got a goat") elif (change == "n" and participant_choice == goats): print("Sorry, you got a goat") else: print("Congratulation, you got a car")