def bubble_sort(collection):
 length = len(collection)
 for i in range((length - 1), (-1), (-1)):
  for j in range(i):
   if (collection[j] > collection[(j + 1)]):
    (collection[j], collection[(j + 1)]) = (collection[(j + 1)], collection[j])
 return collection

def bubble_sort ( collection ) : length = len ( collection ) for i in range ( ( length - 1 ) , ( - 1 ) , ( - 1 ) ) : for j in range ( i ) : if ( collection [ j ] > collection [ ( j + 1 ) ] ) : ( collection [ j ] , collection [ ( j + 1 ) ] ) = ( collection [ ( j + 1 ) ] , collection [ j ] ) return collection
pure implementation of bubble sort algorithm in python .