Computer Science - Text-Based Programming - Python - While loops - Loop Tracing Challenge
Trace through while loops. P1: x=10; while x>0: x-=3; print(x) → What values are printed? (7, 4, 1, -2). P2: 'Count to 100 by 7s' → n=7; while n ___: print(n); n ___ [<= 100, += 7]. P3: 'Find first power of 2 above 1000' → x=1; while x ___: x *= 2 [<= 1000] → answer is 1024. P4: 'Sum digits of a num