Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sorting(list1, counter=0):
- while counter < len(list1)- 1:
- if list1[counter] > list1[counter + 1]:
- item = list1.pop(counter)
- list1.insert(counter + 1, item)
- counter = 0
- return sorting(list1, counter)
- else:
- counter += 1
- return sorting(list1, counter)
- print(list1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement