这两个代码示例之间的根本区别是什么?

时间:2018-09-16 14:48:57

标签: python

这两个代码示例之间的根本区别是什么?

以任务背景{@ {3}}

链接到我的教程

我注意到的是

  • 在打印最终I与打印拆分时,我看到Final使用[]拆分每个元素
  • 那是为什么?
  • 对此有某些术语吗?

示例:

three_rows = ["Albuquerque,749", "Anaheim,371", "Anchorage,828"]
final_list = []
for row in three_rows:
    split_list = row.split(',')
    print(split_list)

示例:

three_rows = ["Albuquerque,749", "Anaheim,371", "Anchorage,828"]
final_list = []
for row in three_rows:
    split_list = row.split(',')
    final_list.append(split_list)
print(final_list)

0 个答案:

没有答案