0.。用if逻辑判断排序
``````a = int(input())
b = int(input())
c = int(input())
nums = []
for i in range(3):
nums.append(int(input('{}:'.format(i))))
if a > b and a>c:
if b > c:
print(a,b,c)
else:
print(a,c,b)
elif b>a and b>c:
if a>c:
print(b,a,c)
else:
print(b,c,a)
elif a == b:
if a>c:
print(a,b,c)
else:
print(c,a,b)
elif a>b:
print(c,a,b)
else:
print(c,b,a)
``````

1.。用min,max排序
``````nums = []
for i in range(3):
nums.append(int(input('{}:'.format(i))))
print(nums)
while True:
cur = min(nums)
print(cur)
nums.remove(cur)
if len(nums) == 1:
print(nums[0])
break
``````

2.。直接用sort对列表排序
``````list1 = []
for i in range(3):
list1.append(int(input('{}:'.format(i))))
print(list1)
list1.sort
print(list1)
``````
3.。最基础的冒泡排序法
``````num_list = [1,8,9,5,5,4,7,7,1,4]
print(num_list)
length = len(num_list)
count_swap = 0

for i in range(length):
for j in range(length-i-1):
if num_list[j] > num_list[j+1]:
tmp = num_list[j]
num_list[j] = num_list[j+1]
num_list[j+1] = tmp
count_swap +=1
print(num_list,count_swap)
``````

``````num_list = [1,8,9,5,5,4,7,7,1,4]
print(num_list)
length = len(num_list)
count_swap = 0

for i in range(length):
for j in range(length-i-1):
flag = False
if num_list[j] > num_list[j+1]:
tmp = num_list[j]
num_list[j] = num_list[j+1]
num_list[j+1] = tmp
flag = True
count_swap +=1
if not flag:
break
print(num_list,count_swap)

``````