len() answered a ten million item list in 2.48 microseconds while a Python loop over the same list took 313 milliseconds. I timed both paths, and a difference of 126,313 times comes from a stored value rather than a faster way to count, which decides the length call you want once the data is nested […]
Want to know the latest news and articles posted on AskPython?
Then subscribe to their feed now! You can receive their updates by email, via mobile or on your personal news page on this website.
See what they recently published below.
Website title: Home - AskPython