【Python练习题】(1,2,3,-5,-4,5,9,-8,-1)排序

完成一个函数,将所给点(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()

你可能感兴趣的:(【Python练习题】(1,2,3,-5,-4,5,9,-8,-1)排序)