Skip to content

Conversation

@albab
Copy link

@albab albab commented Feb 8, 2016

Fixed functions

"""
distance = None # Add the algorithm to compute manhattan distance here
distance = sum(abs(a-b) for a,b in zip(a,b)) # Add the algorithm to compute manhattan distance here
return distance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice use of zip, abs, and sum. I suspect you will like the functional programming week.

@jlaura
Copy link
Contributor

jlaura commented Feb 11, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants