A while loop that keeps halving
Predict the output · Medium · §7.4 While it is true
Predict the output without running the code.
Code
n = 50
count = 0
while n > 10:
n = n // 2
count += 1
print(n, count)Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.