Why List Comprehensions Are Faster Than Normal Lists

preview_player
Показать описание
If you're coding in Python, then you're probably familiar with list comprehensions by now. In this video we will be covering the speed optimization of list comprehensions vs the conventional way of creating a list.
Рекомендации по теме
Комментарии
Автор

I like this series where you let us know about optimisations in codes. Please keep this up 🤩🤩 Awesome series!

costube
Автор

What if you keep numbers.append in variable to avoid dot notation in loop for normal list creation? Would it be faster than list comprehansion?

IrbisTheCat
Автор

Nice video, however a function with this snippet of code : "return list( range( 0, limit * 2, 4) )" returns the same result as both other functions and is 90% faster than the comprehensive methode.

HanWechgelaer
Автор

What about numbers + [number]? Would that be equally faster?

yt_is_a_pussy