How to obtain a subarray in python 3

Use list comprehension for this

print ([i[3:6] for i in a[0:2]])

Leave a Comment