Guest User

monty-huyonty

a guest
Nov 19th, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.29 KB | None | 0 0
  1. import sys, random, os
  2.  
  3. i=1
  4. win=0
  5. los=0
  6.  
  7.  
  8. while True:
  9.     doors=['left','central','right']
  10.     wins = "{:.0%}".format(win/i)
  11. #   os.system ('clear');
  12.     print ('=======================================')
  13.     print ('This is game No.'+str(i))
  14.     print ('Wins: '+str(win) + 'Los: '+str(los)+ ' Winning stat: {:.2%}'.format(win/i))
  15.     print ('\nSelect your door:')
  16.     print ('1 - left')
  17.     print ('2 - central')
  18.     print ('3 - right')
  19.  
  20.     choice_num= input('What door do you choose? ')
  21.     choice = doors[int(choice_num)-1]
  22.     print ('You have selected '+str(choice)+' door!')
  23.  
  24.     prize=random.choice(doors)
  25.     not_wining_doors=doors
  26.     not_wining_doors.remove(prize)
  27.     try:
  28.         not_wining_doors.remove(choice)
  29.     except:
  30.         pass
  31.  
  32.     offer=random.choice(not_wining_doors)
  33.  
  34.     best_choice=['left','central','right']
  35.     best_choice.remove(offer)
  36.     best_choice.remove(choice)
  37.  
  38.     print ('Look: behind '+str(offer)+'door is nothing!')
  39.     print ('Wanna to change yor mind, and select '+str(best_choice)+' instead?')
  40.     print ('1 - yes')
  41.     print ('2 - no')
  42.  
  43.     new_choice= int(input('?: '))
  44.     if new_choice == 1:  choice=best_choice
  45.     print ('You have selected '+str(choice)+' door!')
  46.     print ('Prize is behind '+str(prize)+' door!');
  47.  
  48.     if prize in choice:
  49.         print ('You win!');
  50.         win=win+1
  51.     else:
  52.         print ('You loose!')
  53.         los=los+1
  54.     i=i+1
  55.  
Advertisement
Add Comment
Please, Sign In to add comment