Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys, random, os
- i=1
- win=0
- los=0
- while True:
- doors=['left','central','right']
- wins = "{:.0%}".format(win/i)
- # os.system ('clear');
- print ('=======================================')
- print ('This is game No.'+str(i))
- print ('Wins: '+str(win) + 'Los: '+str(los)+ ' Winning stat: {:.2%}'.format(win/i))
- print ('\nSelect your door:')
- print ('1 - left')
- print ('2 - central')
- print ('3 - right')
- choice_num= input('What door do you choose? ')
- choice = doors[int(choice_num)-1]
- print ('You have selected '+str(choice)+' door!')
- prize=random.choice(doors)
- not_wining_doors=doors
- not_wining_doors.remove(prize)
- try:
- not_wining_doors.remove(choice)
- except:
- pass
- offer=random.choice(not_wining_doors)
- best_choice=['left','central','right']
- best_choice.remove(offer)
- best_choice.remove(choice)
- print ('Look: behind '+str(offer)+'door is nothing!')
- print ('Wanna to change yor mind, and select '+str(best_choice)+' instead?')
- print ('1 - yes')
- print ('2 - no')
- new_choice= int(input('?: '))
- if new_choice == 1: choice=best_choice
- print ('You have selected '+str(choice)+' door!')
- print ('Prize is behind '+str(prize)+' door!');
- if prize in choice:
- print ('You win!');
- win=win+1
- else:
- print ('You loose!')
- los=los+1
- i=i+1
Advertisement
Add Comment
Please, Sign In to add comment