# Online Python compiler (interpreter) to run Python online.# Write Python 3 code in this online editor and run it.import numpy as npdoors = ["goat","goat","car"]#1st choice will be door you choose, 2nd choice will be door that is revealed.#This code simulates your selection of a door, and the door that is randomly revealed.print("test:",np.random.choice(doors,2,replace=False))num_cars_won_if_switched = 0num_goats_revealed = 0for i in range(10000):trial = np.random.choice(doors,2,replace=False)if trial[1] == "goat":#door revealed was a goatnum_goats_revealed += 1if trial[0] == "goat":num_cars_won_if_switched += 1print(num_cars_won_if_switched/num_goats_revealed)