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()

创建一个test列表列表中的数据依次为-1534781210。1输出列表中的数据输出数据的顺序必须与我们给到的数据顺序一致2将列表中的数据升序排序并输出

原文地址: https://www.cveoy.top/t/topic/jf23 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录