a = int(input(“first number>>>”))
b = int(input(“second number>>>”))
c = int(input(“third number>>>”))
if a > b:
if b > c:
print(a,b,c)
elif a > c:
print(a,c,b)
else:
print(c,a,b)
else: #a <= b
if a > c:
print(b,a,c)
elif b > c: #a <= c
print(b,c,a)
else:
print(c,b,a)
2.列表
nums = []
for i in range(3):
nums.append(int(input(‘{}:’.format(i))))
if nums[0] > nums[1]:
if nums[0] > nums[2]:
l1 = nums[0]
if nums[1] > nums[2]:
l2 = nums[1]
l3 = nums[2]
else:
l2 = nums[2]
l3 = nums[1]
else:
l1 = nums[2]
l2 = nums[0]
l3 = nums[1]
else: #nums[0] <= nums[1]
if nums[0] < nums[2]:
l3 = nums[0]
if nums[1] > nums[2]:
l1 = nums[1]
l2 = nums[2]
else:
l1 =