def bubbleSort(values):
for i in range(len(values)):
for j in range(len(values)-1):
if values[j] > values[j+1]:
values[j] ,values[j+1] = values[j+1], values[j]
return values
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter