Skip to content

Instantly share code, notes, and snippets.

@maryrosecook
Last active August 29, 2015 14:11
Show Gist options
  • Save maryrosecook/b4f0adf0129b7778c0b6 to your computer and use it in GitHub Desktop.
Save maryrosecook/b4f0adf0129b7778c0b6 to your computer and use it in GitHub Desktop.
# Unfunctional version:
names = ['Mary', 'Isla', 'Sam']
'''
for i in range(len(names)):
names[i] = hash(names[i])
print names # => [6306819796133686941, 8135353348168144921, -1228887169324443034]
'''
# Rewrite the code above as a map
# Expected answer: [6306819796133686941, 8135353348168144921, -1228887169324443034]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment