How to access multiple indices of a list in Python

preview_player
Показать описание
Accessing multiple indices of a list returns the values of a list at multiple indices. For example, accessing indices 0 and 2 of [1, 2, 3] returns [1, 3].

Call map(list.__getitem__, indices_list) to return a mapping of the accessed indices. list.__getitem__ is a builtin Python function that returns the value at a given index from the list. Call list(map) with map as the mapping to convert the mapping into a list.

#shorts #youtubeshorts #listinpython #pythonlist #python #listsinpython #pythonlists
Рекомендации по теме
Комментарии
Автор

Best example of python functional Programming using magic method implemention with map function !
🖖

SP-dbsh
Автор

I needed this yesterday it's to bad youtube doesn't have the ability to save shorts to a playlist thank you tho

tonyjoffre
Автор

what is written after indices to access in line 3

Kunaru