Write a python code to perform the task of bubble sorting in a list.
arr = [1, 10, 5, 4, 8]
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]
                
bubble_sort(arr)