How do I sort a list with positives coming before negatives with values sorted respectively?

前端 未结 0 702
温柔的废话
温柔的废话 2021-02-11 17:18

I have a list that contains a mixture of positive and negative numbers, as the following

lst = [1, -2, 10, -12, -4, -5, 9, 2]

What I am trying

相关标签:
回答
  • 消灭零回复
提交回复
热议问题