小编jui*_*xie的帖子

Python:如何将for循环的结果合并到一个输出中?

numbers = [1, 2, 3]

for number in numbers:
   number = number * 2 

#For the output I will get:
2
4
6
Run Code Online (Sandbox Code Playgroud)

如何修改我的代码以便结果可以合并(例如[2,4,6])而不使用print语句?

python iteration for-loop output

0
推荐指数
1
解决办法
6973
查看次数

标签 统计

for-loop ×1

iteration ×1

output ×1

python ×1