Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. max = 10000
  2. num = max//2
  3. k=num//2
  4. b=False
  5. m=False
  6. s=0
  7. while True:
  8.    
  9.     res = input(str(num)+ ' eto vashe chislo?(y/n)\n')
  10.     if res == 'n':
  11.         res = input('vashe chislo bolshe ili menshe?(b/m)\n')
  12.         if res == 'm':
  13.             m = True
  14.             if b==True:
  15.                 k=k-k//2
  16.             if k == 0:
  17.                 k = 1
  18.             num -=k
  19.         else:
  20.             b = True
  21.             if m == True:
  22.                 k=k-k//2
  23.                 if k == 0:
  24.                     k=1
  25.             num+=k
  26.  
  27.     s+=1
  28.     print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement