def romanToInt(self, s: str) -> int
This is function name and this format is used in python. I am confused why we are using this arrow and why we are using int
inside paranthesis after s
. Can someone explain please?
def romanToInt(self, s: str) -> int
This is function name and this format is used in python. I am confused why we are using this arrow and why we are using int
inside paranthesis after s
. Can someone explain please?
They are function annotations.
->
marks the return function annotation indicating the function returns an int
.
The : str
indicates a string argument.
You can read more about them here.