完成一个函数,将所给点(1,2,3,-5,-4,5,9,-8,-1)重新排列,使得所有负数都在正数的左边
def answer():
num=[1,2,3,-5,-4,5,9,-8,-1]
num.sort()
print(num)
answer()
def answer():
num=[1,2,3,-5,-4,5,9,-8,-1]
num.sort()
print(num)
answer()
本文标题:【Python练习题】(1,2,3,-5,-4,5,9,-8,-
本文链接:https://www.haomeiwen.com/subject/qzujiqtx.html
网友评论