numList = [7, 11, 3, 10, 17, 23, 1, 4, 21, 5]
n = len(numList)
for i in range(3):
for j in range(0, n - i - 1):
if numList[j] > numList[j + 1]:
numList[j], numList[j + 1] = numList[j + 1], numList[j]
print("Partially sorted list after three passes of Bubble sort:")
print(numList)
Output
Partially sorted list after three passes of Bubble sort:
[3, 7, 10, 1, 4, 11, 5, 17, 21, 23]