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

Edodovivmagarwal
Computer Science - Text-Based Programming - Python - While loops - Loop Tracing Challenge
Log in

Preparing your experience...

Loading scripts and resources

Comments (0)

0/5000

Comments are reviewed before appearing publicly.

About this Experience

Computer Science - Text-Based Programming - Python - While loops - Loop Tracing Challenge

vivmagarwal
vivmagarwalJan 29, 2026

Description

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

Details

Computer ScienceText-Based Programming - PythonStage 7, Class 7, Class 7, Grade 7

Engagement

8

Likes

0

Remixes

0

Comments