冒泡排序-python
2021-06-05 00:02
阅读:731
标签:技术 pre ber append value number except err lazy
source program:
list=[]
while True:
print("how many number input:")
try:
num=int(input())
for i in range(num):
a=int(input("input"+str((i+1))+"integer:"))
list.append(a)
except ValueError:
print("error!")for j in range(len(list)-1):
for k in range(len(list)-1):
if list[k]1]:
t=list[k]
list[k]=list[k+1]
list[k+1]=t
print(list)
冒泡排序-python
标签:技术 pre ber append value number except err lazy
原文地址:https://www.cnblogs.com/duanqibo/p/14640483.html
评论
亲,登录后才可以留言!