type defenition syntax python code example
Example 1: python function argument type
def pick(l: list, index: int) -> int:
return l[index]
Example 2: type declaration python
def greeting(name: str) -> str:
return 'Hello ' + name
def pick(l: list, index: int) -> int:
return l[index]
def greeting(name: str) -> str:
return 'Hello ' + name