def bubble_pass(original):
counter = 0
for i, v in enumerate(original[:-1]): #:-1 so it doesn't try to compare the last number to the non-existant one after it
print str(i) + ": " + str(v)
if v > original[i+1]:
original[i], original[i+1] = original[i+1], original[i]
counter += 1
return counter, original
steps, sorted_list = bubble_pass([1, 4, 3, 2, 6, 5])
ZGVmIGJ1YmJsZV9wYXNzKG9yaWdpbmFsKToKICAgIGNvdW50ZXIgPSAwCiAgICBmb3IgaSwgdiBpbiBlbnVtZXJhdGUob3JpZ2luYWxbOi0xXSk6ICM6LTEgc28gaXQgZG9lc24ndCB0cnkgdG8gY29tcGFyZSB0aGUgbGFzdCBudW1iZXIgdG8gdGhlIG5vbi1leGlzdGFudCBvbmUgYWZ0ZXIgaXQKICAgICAgICBwcmludCBzdHIoaSkgKyAiOiAiICsgc3RyKHYpCiAgICAgICAgaWYgdiA+IG9yaWdpbmFsW2krMV06CiAgICAgICAgICAgIG9yaWdpbmFsW2ldLCBvcmlnaW5hbFtpKzFdID0gb3JpZ2luYWxbaSsxXSwgb3JpZ2luYWxbaV0KICAgICAgICAgICAgY291bnRlciArPSAxCiAgICByZXR1cm4gY291bnRlciwgb3JpZ2luYWwKICAgIApzdGVwcywgc29ydGVkX2xpc3QgPSBidWJibGVfcGFzcyhbMSwgNCwgMywgMiwgNiwgNV0pCg==