sort(arr) python code example
Example 1: sort array python
array = [1, 2, 3, 19, 11, 90, 0]
array.sort()
print(array)
Example 2: sort python
>>> x = [1 ,11, 2, 3]
>>> y = sorted(x)
>>> x
[1, 11, 2, 3]
>>> y
[1, 2, 3, 11]
array = [1, 2, 3, 19, 11, 90, 0]
array.sort()
print(array)
>>> x = [1 ,11, 2, 3]
>>> y = sorted(x)
>>> x
[1, 11, 2, 3]
>>> y
[1, 2, 3, 11]