elif doorpick = and showgoatdoor = doorpick elif doorpick = and showgoatdoor = doorpick elif doorpick = and showgoatdoor = doorpick elif doorpick = and showgoatdoor = doorpick open all the doorsif doorthathascar = print(first_car_others_goatelif doorthathascar = print(second_car_others_goatelif doorthathascar = print(third_car_others_goatprint('door {has the car!format(doorthathascar)record wins and losses for swapping and not swappingif doorpick =doorthathascarprint('you won!'if swap =' 'swapwins + elif swap =' 'staywins + elseprint('sorryyou lost 'if swap =' 'swaplosses + elif swap =' 'staylosses + calculate success rate of swapping and not swappingtotalswaps swapwins swaplosses if totalswaps ! prevent zero-divide error swapsuccess round(swapwins totalswaps elseswapsuccess totalstays staywins staylosses if (staywins staylosses! prevent zero-divide staysuccess round(staywins totalstays elsestaysuccess print(print('swapping'end=''print('{wins{lossesformat(swapwinsswaplosses)end=''print('success rate {}%format(swapsuccess)print('not swapping'end=''print('{wins{lossesformat(staywinsstaylosses)end=''print('success rate {}%format(staysuccess)print(input('press enter to repeat the experiment 'monty hall problem