输入三个整数x,y,z,请把这三个数从小到大输出
def isint(num):
while True:
a = input('请输入整数 %s:' %num).strip()
if a.isdigit():
a = int(a)
break
else:
print(' %s 不是整数,请重新输入' %a)
return a
dic = {}
dic['x'] = isint('x')
dic['y'] = isint('y')
dic['z'] = isint('z')
ls = list(dic.values())
ls.sort()
print(ls)
网友评论