Python, Data Science, Artificial Intelligence, Programming, Tips.
sum_squares(int n): cdef int i, total = 0 for i in range(n): total += i * i return total To compile the Cython code, you need to create a setup file: # setup.py from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize("cython_example.pyx") ) Then, compile