Need Help with Roman to Int, python

Below is the solution on leetcode by someone. But I need help understanding what they have done. First, the : in def romanToInt(self, s: str). What is : doing here? Is it like an = sign?
Second: How do i get this code to work in VS code, so I can test if it works. I cannot work out how to get it to run. There is no print statement, or function call in the example.

class Solution:
    def romanToInt(self, s: str) -> int:
        roman_to_integer = {
            'I': 1,
            'V': 5,
            'X': 10,
            'L': 50,
            'C': 100,
            'D': 500,
            'M': 1000,
        s = s.replace("IV", "IIII").replace("IX", "VIIII").replace("XL", "XXXX").replace("XC", "LXXXX").replace("CD", "CCCC").replace("CM", "DCCCC")
        return sum(map(lambda x: roman_to_integer[x], s))

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Like the -> int on the same line, it is an annotation. It is kind of like a comment for the function.

In this case, the s parameter value is supposed to be a string or that the input to the function should be a string. The part after the : is just a text string and could be anything.

The -> int is expressing that the return value of the function is an integer.

Keep in mind these are just comments and not actual type declarations (like TypeScript in JavaScript).

Think of it as a short-hand version of:

def romanToInt(self, s: str) -> int: # s parameter is asString, function returns an integer

Using normal comments clutters up the line. Using the annotation is more concise.