这两个代码示例之间的根本区别是什么?
以任务背景{@ {3}}
链接到我的教程我注意到的是
[]
拆分每个元素示例:
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)