What does the following program print?
= 10
count while count < 21:
print(count, end=" ")
+= 3 count
Consider the following program:
= 12345
n = 0
m while n != 0:
= (10 * m) + (n % 10)
m //= 10 n
while
loop
executed?m
and n
after the
code is executed?Consider the following code, which has two missing snippets, marked
[[1]]
and [[2]]
.
= [[1]]
i while [[2]]:
+= 1
i print(i)
Consider the following candidates to replace the missing snippet
[[1]]
:
0
1
10
and the following candidates to replace missing snipped
[[2]]
:
i < 9
i <= 9
i < 10
i <= 10
To form a complete program, we need to pick a pair of snippets, one
to replace [[1]]
and one to replace [[2]]
.
Consider the following program:
= 0
i while i < 4:
= 1
j while j < 11:
print('*', end='')
+= 1
j += 1
i print()
*
) are printed by the program?i
and j
at the end
of the program?