Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Sorting Function

By: jdeluxh on Mar 23rd, 2013  |  syntax: Python  |  size: 0.36 KB  |  hits: 101  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def sorting(list1, counter=0):
  2.     while counter < len(list1)- 1:
  3.         if list1[counter] > list1[counter + 1]:
  4.             item = list1.pop(counter)
  5.             list1.insert(counter + 1, item)
  6.             counter = 0
  7.             return sorting(list1, counter)
  8.         else:
  9.             counter += 1
  10.             return sorting(list1, counter)
  11.     print(list1)