Advertisement
Guest User

2

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