Ubisoft Interview Question

Code a function in Python and then in C++