Skip to content

Instantly share code, notes, and snippets.

@narendranathjoshi
Created June 23, 2016 07:15
Show Gist options
  • Save narendranathjoshi/f779b821ced3ca44780b7e5380b80560 to your computer and use it in GitHub Desktop.
Save narendranathjoshi/f779b821ced3ca44780b7e5380b80560 to your computer and use it in GitHub Desktop.
Quick Sort One Liner in Python
qsort = lambda l : [x for x in l[1:] if x < l[0]] + [l[0]] + [x for x in l[1:] if x >= l[0]]
#usage
qsort([7,5,2,8])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment