How to Print Even Position Elements of List in Python ? #shorts

preview_player
Показать описание
How to Print Even Position Elements of List in Python ? #shorts

#youtubeshorts #pythontutorial #shortsfeed #shortsvideo #short #codingthings #viral #viralshorts #ytshorts

Комментарии
Автор

You can also just step the loop by 2, no checks required

grayblack
Автор

print([i for n, i in enumerate(lst) if n % 2 == 0])

newfi