p/popular-javascript-interview-questions
Free ebook Most popular Javascript interview questions
Anna Danilec

Loops in Python Comparison & Performance — Compare python loops and verify their performance in ms.

1
This article compares the performance of several approaches when summing two sequences element-wise:
-Using the while loop
-Using the for loop
-Using the for loop with list comprehensions
-Using the third-party library numpy
Replies
Best
Anna Danilec
However, performance isn’t the only concern when developing software. Moreover, according to Donald Knuth in The Art of Computer Programming, “premature optimization is the root of all evil (or at least most of it) in programming”.