-3
创建2个元素的列表 -列表理解 - 2元素列表
["atom", "nuclei", "neuron"] to display as:
计数与列表和结果的数量来显示这样的事情=
[["atom",4], ["nuclei",6], ["neuron", 6], ["physics", 7]]
创建2个元素的列表 -列表理解 - 2元素列表
["atom", "nuclei", "neuron"] to display as:
计数与列表和结果的数量来显示这样的事情=
[["atom",4], ["nuclei",6], ["neuron", 6], ["physics", 7]]
这里:
>>> my_list = ["atom", "nuclei", "neuron"]
>>> [[v, len(v)] for v in my_list]
[['atom', 4], ['nuclei', 6], ['neuron', 6]]