Horje
can is slice list with list of indices python Code Example
can is slice list with list of indices python
lst = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
indices = [0, 2, 6]
out = [lst[i] for i in indices]




Python

Related
python cv2 unblur Code Example python cv2 unblur Code Example
Print inline output in python Code Example Print inline output in python Code Example
poision in chinese Code Example poision in chinese Code Example
negative indexing in Python Code Example negative indexing in Python Code Example
list comprehension Code Example list comprehension Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7