The Python Oracle

Are list-comprehensions and functional functions faster than "for loops"?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Melt

--

Chapters
00:00 Question
00:46 Accepted answer (Score 201)
03:36 Answer 2 (Score 30)
04:15 Answer 3 (Score 15)
05:51 Answer 4 (Score 14)
08:13 Thank you

--

Full question
https://stackoverflow.com/questions/2210...

Answer 1 links:
[info on python.org]: https://wiki.python.org/moin/PythonSpeed...
[timeit]: http://docs.python.org/2/library/timeit....

Answer 3 links:
[@Alisa's code]: https://stackoverflow.com/a/57158292/773...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #performance #forloop #listcomprehension #mapfunction

#avk47