【Python练习题】(1,2,3,-5,-4,5,9,-8,-
2019-04-07 本文已影响0人
小象解答编程练习题
完成一个函数,将所给点(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()