input: Write a Python function to perform bubble sort on a list of numbers.
  assert bubble_sort([2, 8, 12, 18, 5, 7, 1]) == [1, 2, 5, 7, 8, 12, 18]
  assert bubble_sort([5, 3, 8, 4, 2]) == [2, 3, 4, 5, 8]
  assert bubble_sort([3, 6, 1, 9, 2]) == [1, 2, 3, 6, 9]
output: def bubble_sort(arr):
      n = len(arr)
      for i in range(n):
          for j in range(0, n-i-1):
              if arr[j] > arr[j+1]:
                  arr[j], arr[j+1] = arr[j+1], arr[j]
      return arr