You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#host will not open the player's choice on the phase two
12
+
curtains.remove(PlayerChoice)
13
+
# ... or the Ferrari....
14
+
Discard=random.choice(curtains)
15
+
whileDiscard==Ferrari:
16
+
Discard=random.choice(curtains)
17
+
#open one curtain:
18
+
curtains.remove(Discard)
19
+
#phase two
20
+
RemainingCurtain=curtains[0]
21
+
ifRemainingCurtain==Ferrari:
22
+
# if the player changes his choice, he wins
23
+
NumOfWinsIfChange+=1
24
+
else :
25
+
# if the player keeps his choice, he wins
26
+
NumOfWinsIfKeep+=1
27
+
#repeat
28
+
curtains= ['A','B','C']
29
+
print'In 10000 Tests: \nIf player keeps his choice, he wins '+str(NumOfWinsIfKeep) +' times('+str(float(NumOfWinsIfKeep)/float(100))+'%)\nIf he changes his option he wins: '+str(NumOfWinsIfChange)+' times('+str(float(NumOfWinsIfChange)/float(100))+'%)'
0 commit comments