def bubsort(arr):
    for j in range(len(arr)):        
        for i in range(len(arr)-1-j):
            if arr[i] > arr[i+1]:
                arr[i], arr[i+1] = arr[i+1], arr[i]            

arr = [2,4,1,5,3]
print(arr)
bubsort(arr)
print(arr)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: