Let’s put the C++ and Python codes side-by-side to compare them (You can click on the image for a larger version)
Firstly, the main function is not needed in Python. When you run a Python script, everything that’s not defined in a function or class will be executed.
