Want More EFFICIENT Code? Use THIS In Python! 🔥

preview_player
Показать описание
Want more efficient code? Then use THIS In #Python. #Shorts
Рекомендации по теме
Комментарии
Автор

Possibly the memory difference is mainly due to the fact that list have pre allocated size on memory (and more pre allocated size is added as the list grows in size as we add items).

federicobau
Автор

I watch these videos as if I program

After seeing so many I migh just have to start

BigBargeXL
Автор

I think one is more memory efficient, while the other is faster to create

knut-olaihelgesen
Автор

So basically a tuple is better for fixed variables???

afcaptain
Автор

Is it a good idea to have list of touples?

gabef
Автор

Since when the python programmers are concerned about optimization?

cipherxen
Автор

Ey list and ey tuple make ey developer ey very happy person

bryce-bryce
Автор

80 bytes for 5 numbers??? Isn't a number 4 bytes long?

zxopink
Автор

But why did you pronounce category like that

Adam-ysgn
Автор

I got this result running python3 via iSh on my iPhone
60 bytes
40 bytes

JohnWasinger
Автор

If you care that much about that tiny bit of performance difference, you’re using the wrong language.

Bjoernqqq
Автор

you are right, but for the wrong reason. You shouldnt use tuples bcs they are faster, but to have code that is more expressive. You are breaking the "beware of premature optimization" rule of clean code if you use it bcs of speed in the first place for 5 elements

MisterAssasine