Rewrite code from C++ to Python

Printable View