Python program to print the sorting numbers in ascending order

Python program to print the sorting numbers in ascending order. Python programming allows you to sort the numbers in ascending order. In Python, this program sorts items in ascending order. For the beginners, this ascending order program arranges data in ascending order.

array = [6,78,34,56,88]; 
temporary = 0; 
print("The array entered"); 
for i in range(0, len(array)): 
print(array[i], end=" ");
for i in range(0, len(array)): 
for j in range(i+1, len(array)): 
if(array[i] > array[j]): 
temporary = array[i]; 
array[i] = array[j]; 
array[j] = temporary; 
print(); 
print("Number listed in ascending order "); 
for i in range(0, len(array)): 
print(array[i], end=" ");

 

Output:

The array entered

6 78 34 56 88

Number listed in ascending order

6 34 56 78 88