python types list code example
Example 1: python type == list
if isinstance(object, list):
## DO what you want
Example 2: python function argument type
def pick(l: list, index: int) -> int:
return l[index]
Example 3: python typing list of strings
from typing import List
def my_func(l: List[int]):
pass
Example 4: specify return type python function
def greeting(name: str) -> str:
return 'Hello, {}'.format(name)