Skip to content

Instantly share code, notes, and snippets.

@cjw296
Created March 13, 2017 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjw296/4b7850ab0d66690d2cf5dacea03ad563 to your computer and use it in GitHub Desktop.
Save cjw296/4b7850ab0d66690d2cf5dacea03ad563 to your computer and use it in GitHub Desktop.
def dot(l, k):
if len(l) != len(k):
return 0
if not (l or k):
return 0
return l[0]*k[0] + dot(l[1:], k[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment