Calculating Factors of a Number in C++ and Python

Original Code

Converted Code