If we take a closer look at the code for bubble sort, we might notice that we have two for loops. Let's talk a bit about how they work.

Notice how the list got reordered. Isn't that cool?