Dynamic typing vs static typing

def search(self, nums: List[int], target: int) -> int:

If python is dynamically types then what is the use of writing parameters that way