def bubble_sort(li):
    """ Python implementation of bubble sort
    args:
        li = unordered list of elements in integer
    returns:
        ordered list of input li in ascending order
    BigO:
        O(n**2): there are better ways to implemet sorting
                 i.e)quicksort, mergesort
    """
    li_length = len(li)

    for i in range(li_length - 1):
        for j in range(li_length - 1):
            if li[j] > li[j + 1]:
                temp = li[j+1]
                li[j+1] = li[j]
                li[j] = temp
                ''' better code
                reference: https://github.com/minsuk-heo/problemsolving\
                           /blob/master/sort/BubbleSort.py

                alist[j], alist[j+1] = alist[j+1], alist[j]
                '''
    return li