问题遇到的现象和发生背景
通过使用for循环显示大于21的数字。请确保你的输出与例子相符。
用代码块功能插入代码,请勿粘贴截图
numbers= [12, 15,20,21, 32, 42, 55, 75, 122, 132, 20,176, 200]
for i in numbers:
if i >= 32 :
numbers.append(i)
print(i)
我想要达到的结果
希望只运行一次
问题遇到的现象和发生背景
通过使用for循环显示大于21的数字。请确保你的输出与例子相符。
用代码块功能插入代码,请勿粘贴截图
numbers= [12, 15,20,21, 32, 42, 55, 75, 122, 132, 20,176, 200]
for i in numbers:
if i >= 32 :
numbers.append(i)
print(i)
我想要达到的结果
希望只运行一次
numbers = [12, 15, 20, 21, 32, 42, 55, 75, 122, 132, 20, 176, 200]
result = []
for i in numbers:
if i > 21:
result.append(i)
print(result)
是否可行