Created
November 29, 2017 19:24
-
-
Save ehermes/9fc6f6dc9f785af3e7edb197667676ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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