Define a function
Defining a function that takes 2 integer arguments and returns its sum.
Python
def add(a, b):
"""Adds a to b"""
return a + b
Python with typing annotations
It looks more similar to Rust.
def add(a: int, b: int) -> int:
"""Adds a to b"""
return a + b
Rust