python function as parameters
An example of passing in a function as a parameter. Also notice that we have define typings.
from typing import Callable
def hello(x):
return x.upper()
def a(func: Callable[[str], str]):
print(func("abc"))
a(hello)
Comments