How add type annotation?
- We already saw the two examples:
- Add type annotation to variables.
- Add type annotation to the function signature.
def add(x: int, y: int) -> int:
return x + y
def multiply(x, y):
res: int = x * y
return res
a: int = 23
z: int = add(a, 19)
result = multiply(a, 19)