Advertisement
kealeydodds

Untitled

Sep 16th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #implementing a bubble sort
  2.  
  3. my_list= [5, 9, 5, 8, 1, 3]
  4. def bubble_sort(unsorted):
  5. sorted= old_list [:]
  6. for i in range(len(sorted) -1):
  7. if sorted [i] > sorted [i+1]:
  8. sorted [i], sorted [i+1] = sorted [i+1], sorted [i]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement