def bubbleSort(aList): for passNumber in range(len(aList)-1,0,-1): for i in range(passNumber): if aList[i]>aList[i+1]: temp=aList[i] aList[i]=aList[i+1] aList[i+1]=temp #aList[i],aList[i+1]=aList[i+1],aList[i] def selectionSort(aList): for fillSlot in range(len(aList)-1,0,-1): positionOfMax=0 for location in range(1,fillSlot+1): if aList[location]>aList[positionOfMax]: positionOfMax=location temp=aList[fillSlot] aList[fillSlot]=aList[positionOfMax] aList[positionOfMax]=temp