Python to C++ scripting assignment