def bubbleSort(): swapped = True n = len(myList) while swapped == True: swapped = False n = n - 1 for p in range(0,n): if myList[p] > myList[p+1]: temp = myList[p] myList[p] = myList[p+1] myList[p+1] = temp swapped = True myList = [9,65,5,12,13,8] print (myList) bubbleSort() print (myList)