005.py

来源:互联网 发布:手机淘宝怎么评价卖家 编辑:程序博客网 时间:2024/05/23 19:13

题目:输入三个整数x,y,z,请把这三个数由小到大输出

 

#the first code
x=int(input('please input x\n'))
y=int(input('please input y\n'))
z=int(input('please input z\n'))

if x    ify       print(x,y,z)
    else:
       ifx           print(x,z,y)
       else:
           print(z,x,y)
else:
   pass        #与上面雷同。。。

#the second

#python 中自带了排序函数sort(),构造一个序列即可自动排序

l = []
for i in range(3):
    x =int(raw_input('integer:\n'))
   l.append(x)
l.sort()
print l

0 0
原创粉丝点击