Every Python Dev Should Know THIS Trick #code #python #programming

preview_player
Показать описание
Every Python dev should know this trick. #code #python #programming
Рекомендации по теме
Комментарии
Автор

If you're actually doing something with the enumerated items and want to accumulate the results, map() with a lambda is very succinct.

davidgillies
Автор

Nice bideo! I always used for i in range(elems) and printed elem[i+1]

utarasama
Автор

I guess number of lines can be further reduced by list comprehension

iam_sangu
Автор

for i, elem in zip(range(1, len(elems) + 1), elems):
print(f"{i}: {elem}")

barkmemes
Автор

*arr*.index(*obj*) returns the index of that object in the array if all values in the array are different. And it's a little bit slower

AndrewX
Автор

Can you please make a video on enumerate it's confusing 😅

LimitlessGamers
Автор

Hi, thanks a lot for the content! Can someone explain to me the function of f' in syntax?

berkkucuk
Автор

I dont use python, but i used this knowledge to use the Iterator::enumerate() in rust :D

xijnin
Автор

I really don't like enumerate. I almost always prefer accessing via index. Just personal preference though

realitant
Автор

But then the variable should not be named i.

vcpmxvs
Автор

Чтото не так. Где earrape и крайне убеждающие маты? Помоему я перепутал канал...

BoBoNUto
Автор

I don’t really see why I would need to do that.

floboyyt