TheAlgorithms-Python/BubbleSort.python
Anup Kumar Panwar e58c46237b Bubble Sort
2016-07-16 16:31:51 +05:30

27 lines
339 B
Plaintext

array=[];
# input
print ("Enter any 6 Numbers for Unsorted Array : ");
for i in range(0, 6):
n=input();
array.append(int(n));
# Sorting
print("")
for i in range(0, 6):
for j in range(0,5):
if (array[j]>array[j+1]):
temp=array[j];
array[j]=array[j+1];
array[j+1]=temp;
# Output
for i in range(0,6):
print(array[i]);