input: Write a function to perform bubble sort on a list of integers.
  assert bubble_sort([6,5,3,1,8,7,2,4])==[1,2,3,4,5,6,7,8]
  assert bubble_sort([10,9,8,7,6,5,4,3,2,1])==[1,2,3,4,5,6,7,8,9,10]
  assert bubble_sort([3,3,2,1,2,1])==[1,1,2,2,3,3]
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