Answers for "sort array not in place python"

1

sort array not in place python

# sorting lists in python

l = [2, 3, 1, 4]

new_l = sorted(l)  # returns sorted list without modifying original
l.sort() # sorts list inplace
Posted by: Guest on December-07-2020

Python Answers by Framework

Browse Popular Code Answers by Language