while loops
Watch it run · 1 of 3
Add up the digits of 432
1n = 4322total = 03while n > 0:4 total += n % 105 n //= 106print(total)
Memory
int n
432
int total
0
Output
(nothing yet)line 2Start.
step 1 of 10
Watch it run · 1 of 3
1n = 4322total = 03while n > 0:4 total += n % 105 n //= 106print(total)
Memory
int n
432
int total
0
Output
(nothing yet)line 2Start.