Python 列表操作:创建、输出和排序
test = [-1, 5, 34, 7, 8, 12, 10]
输出列表中的数据
for num in test: print(num, end=' ') print()
将列表中的数据升序排序并输出
test.sort() for num in test: print(num, end=' ') print()
原文地址: https://www.cveoy.top/t/topic/edC2 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
test = [-1, 5, 34, 7, 8, 12, 10]
for num in test: print(num, end=' ') print()
test.sort() for num in test: print(num, end=' ') print()
原文地址: https://www.cveoy.top/t/topic/edC2 著作权归作者所有。请勿转载和采集!