Algorithms in Python: Understanding Bubble Sort

Some theory Bubble sort is one of the most commonly known sorting algorithms. The idea is simple: scan a list of items (say integers) sequentially, from left to right, and compare consecutive pairs of elements starting at index 0. Example: my_numbers = [ 92 , 11 , 45 , 2234 , 0 , 7 , 65 ] # 92 is index 0 and the consecutive pairs are # (92,11), (11,45), (45,2234) and so on ... First we compare…