Python编程:排序输出

输入任意整数,请把这这些数由小到大输出

1 arr=[]
2 for a in range(4):
3     a=int(input('请输入a:'))
4     arr.append(a)
5 arr.sort()
6 print(arr)
View Code

结果:

请输入a:12
请输入a:45
请输入a:8
请输入a:6
[6, 8, 12, 45]

  

原文地址:https://www.cnblogs.com/PPhoebe/p/6708861.html