I like to explore this in terms of Asymptotic Notations: Big(O), Omega and Theta.
Here is a small piece of Python code. And tried running it by giving larger value each time. If you look at the 3rd scenario(image), the code is taking usually longer time to calculate the sum.
I wonder if i can rewrite it sequentially, would there be any difference? How can I optimize this code to take larger values? Thank you