I recently started to learn programming with Python and in some sources I encounter code:
def f(x : int) -> str:
or
def f(x):
"""(int) -> str...."""
When I try the first code it doesn't seem to limit input or output of the function. does that mean they are for code clarity and use of either of them depends personal preference or am I missing something?