Skip to content

Instantly share code, notes, and snippets.

@ehermes
Created November 29, 2017 19:24
Show Gist options
  • Save ehermes/9fc6f6dc9f785af3e7edb197667676ce to your computer and use it in GitHub Desktop.
Save ehermes/9fc6f6dc9f785af3e7edb197667676ce to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3.5
from typing import List
Vector = List[float]
def sum(vec: Vector) -> float:
tot = 0.
for element in vec:
tot += element
return tot
print(sum([1., 2., 3., 4.]))
print(sum([1, 2, 3, 4]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment