loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
num = int(input())
guess = 0
upper = 100
lower = 1
count = 0

while guess != num:
   guess = (lower + upper) // 2
   count += 1 
   if guess<num:
      lower = guess + 1
   else:
      upper = guess - 1

print(count)