python输入三个数输出其中最小的数字

如题所述

nput('请输入一个数组:')
temp=sorted(test)
print '从小到大排序得:',temp
print '您输入的数组中,最大的数为:%g'%temp[-1]
print '您输入的数组中,第二大大的数为:%g'%temp[-2]
'------------------------------------'
#python3下的代码:
test=input('请输入一个数组:')
temp=[]
for i in test.split(','):
temp.append(int(i))
temp=sorted(temp)
print('从小到大排序得:',temp)
print('您输入的数组中,最大的数为:%g'%temp[-1])
print('您输入的数组中,第二大大的数为:%g'%temp[-
温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-01-11
是回送地址,指本地机,一般用来测试使用
相似回答