bubble sort in python with reverse option