Skip to content

Instantly share code, notes, and snippets.

@chriszf
Created September 5, 2012 20:56
Show Gist options
  • Select an option

  • Save chriszf/3644615 to your computer and use it in GitHub Desktop.

Select an option

Save chriszf/3644615 to your computer and use it in GitHub Desktop.
def format(filename, class_type):
"""Creates list of names from file ordered by name length"""
f = open(filename)
file_list = f.read().split()
f.close()
person_list = []
for person in file_list:
person_list.append(class_type)
person_list.sort(key = lambda p: p.length)
return person_list
mentors = format(mentor_list, "Mentor")
players = format(player_list, "Player")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment