Skip to content

Instantly share code, notes, and snippets.

@jfo
Created February 14, 2014 18:01
Show Gist options
  • Save jfo/9005834 to your computer and use it in GitHub Desktop.
Save jfo/9005834 to your computer and use it in GitHub Desktop.
# yuri's solution
def sort_last(tuples):
return sorted(tuples, key=lambda t: t[-1])
# my dumb solution
def sort_lastt(tuples):
# +++your code here+++
diction = {}
for thing in tuples:
diction[thing[-1]] = thing
newtuples = []
i = 0
while i <= 100:
if i in diction.keys():
newtuples.append(diction[i])
i = i + 1
return newtuples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment