Skip to content

Instantly share code, notes, and snippets.

@chingovan
Created June 28, 2015 09:07
Show Gist options
  • Save chingovan/2d0d49c16efa629a5964 to your computer and use it in GitHub Desktop.
Save chingovan/2d0d49c16efa629a5964 to your computer and use it in GitHub Desktop.
a = ['life', 'is', 'not', 'fair', 'get', 'used', 'to', 'it']
def getLastCharacter(s):
return s[-1]
print(a)
b = sorted(a, key=getLastCharacter)
print("List a :" , a)
print("List b : ", b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment