ascending order program in python without sort function code example
Example 1: how to sort list in descending order in python
#1 Changes list
list.sort(reverse=True)
#2 Returns sorted list
sorted(list, reverse=True)
Example 2: sorting numbers in python without sort function
number=[1,5,6,9,0]
for i in range(len(number)):
for j in range(i+1,len(number)):
if number[i]<number[j]:
number[i],number[j]=number[j],number[i]
print(number)