Python while循环
编辑日期: 2024-07-20 文章阅读: 3 次
欢迎来到Python while循环练习题,6
题,在线答题页面!
全选择题
,带有解析。
做过题会缓存
,方便随时复习。
以下代码的输出是什么?
i = 0
while i < 3:
print(i)
i += 1
运行以下代码后,变量count的最终值是多少?
count = 0
while count < 5:
count += 1
if count == 3:
break
以下代码的输出是什么?
count = 0
result = []
while count < 3:
result.append(count * 2)
count += 1
print(result)
运行以下代码后,变量total的值是多少?
total = 0
i = 1
while i <= 5:
total += i
i += 1
print(total)
以下代码的输出结果是什么?
count = 0
while count < 3:
print(count)
count += 1