Skip to content

Instantly share code, notes, and snippets.

@stephen-bunn
Last active April 25, 2019 13:32
Show Gist options
  • Save stephen-bunn/a756c7f3843d32adcc16eed78b9e59a1 to your computer and use it in GitHub Desktop.
Save stephen-bunn/a756c7f3843d32adcc16eed78b9e59a1 to your computer and use it in GitHub Desktop.
Medium - Basic typing sample
from typing import Dict, List
def handle_dictionary(dictionary: Dict[str, List[int]]) -> int:
result = 0
for (key, value) in dictionary:
result += sum(value)
return result
handle_dictionary({"success": [1, 2, 3], "fail": ["1", 2, 3]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment