fork download
  1. bas, lim = 1, 100
  2.  
  3. while lim:
  4. p = bas + lim // 2
  5. g = input(f"{p}? ")
  6. if g == "=":
  7. break
  8. if g == ">":
  9. bas = p + 1
  10. lim -= 1
  11. lim //= 2
  12.  
  13. print("Я выиграл!")
Success #stdin #stdout 0.03s 9648KB
stdin
=
stdout
51? Я выиграл!