sorting a list in python in ascending order without inbuilt function code example
Example 1: how to sort list in ascending order in python
# vowels list
vowels = ['e', 'a', 'u', 'o', 'i']
# sort the vowels
vowels.sort()
# print vowels
print('Sorted list:', vowels)
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)