how to ascending order list in python code example
Example 1: sort an array python
#List
myList = [1,5,3,4]
myList.sort()
print(myList)
#[1,3,4,5]
Example 2: how to sort a list descending python
# defning A as a list
A.sort(reverse = True)
#List
myList = [1,5,3,4]
myList.sort()
print(myList)
#[1,3,4,5]
# defning A as a list
A.sort(reverse = True)