Learn THIS Powerful Python Snippet Of Code

preview_player
Показать описание
Learn this powerful Python snippet of code. #code #python #shorts
Рекомендации по теме
Комментарии
Автор

This is really helpful when you want to compute your data in batches and make a custom made DataLoader function

TheSyedAddan
Автор

also:

>>>data = list('abcdefgh')

is easier to type.

>>>list(iter('abcdefgh'))

to be explicit, which is better than implicit. Or so I have been told.

DrDeuteron
Автор

I like Python, but this is why I prefer Kotlin... Ordered collections already have a chunked(n: Int) method on them.

vorpal
Автор

Why there doesn't raise the error out of range?

allmazd
Автор

why make a function when you can do it all with list comprehension?

ArpenteurDeToile
Автор

Please don't meke hide dynamically types concept from python. Please follow other languages dat types here😢

sgnj
Автор

In the function argument, can the lst: list be typed for list of string?

thedelanyo
Автор

The type hints are satanic. What if I want to use a deque, or a str, or some other types.ContainerType?

DrDeuteron
Автор

I don't get you people why declare list of str when you know it is. Go back to C, C++ or java. Python is dynamic

LuvxJacqulie
Автор

Isn't this similar to itertools.islice?

birdie
Автор

If impatient: import itertools/more-itertools

Shaft