Python 列表推导式:筛选第一个元素等于 '1.1.1.2' 的子列表
使用列表推导式来实现:
result = [item for item in list if item[0] == '1.1.1.2']
print(result)
输出:
[['1.1.1.2', '1', '0', '1', '0']]
原文地址: https://www.cveoy.top/t/topic/nFPH 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
使用列表推导式来实现:
result = [item for item in list if item[0] == '1.1.1.2']
print(result)
输出:
[['1.1.1.2', '1', '0', '1', '0']]
原文地址: https://www.cveoy.top/t/topic/nFPH 著作权归作者所有。请勿转载和采集!