You should be able to:
Program a bubble sort in Python! Watch the video for a guide on how it could work:
The code I used is here but you might want to try to make it more efficient!
myList = [4,234,232,121,1,323,1,2,3,0,2,3,23,45,23]count = 1swapsLeft = count>0while swapsLeft: count=0 for x in range(0,len(myList)-1): y=x+1 if myList[x]>myList[y]: count+=1 a=myList[x] b=myList[y] myList[x]=b myList[y]=a print (myList) swapsLeft = count>0SOURCE RECOGNITION - PLEASE NOTE: The examination examples used in these walking talking mocks are samples from AQA from their non-confidential section of the public site. They also contain questions designed by TeachIT for AQA as part of the publicly available lesson materials.