Python is notorious for being a slow programming language. When looping through problems in most fashions in Python, it can be noticeably slower than languages like C.
There are ways to reduce the amount of time it takes to do larger calculations, no matter how simple.
NumPy vs Python
A great tool to use is NumPy. Being familiar with NumPy and it’s benefits can significantly speed up your code. NumPy is written primarily in C which results in it’s execution time beating Python’s significantly. Below you can see an example of using NumPy Arrays vs Native Python Lists.