Untitled

 avatar
unknown
plain_text
2 years ago
408 B
7
Indexable
import typing

def add(a :int, b :int) -> int:
    return a + b

add(1, 2)


def sum(numbers :typing.List[int]) -> int:
    total = 0
    for number in numbers:
        total += number
    return total


sum([1, 2, 3])


def upper_keys(dictionary :typing.Dict[str,int]) ->  typing.Dict[str,int] :
    return {k.upper(): v for k, v in dictionary.items()}


upper_keys({"a": 1, "b": 2})
Editor is loading...