Answers for "cut a section out of a list python"

0

cut a section out of a list python

>>> [1,2,3,4,5,6,7,8][:5]
[1, 2, 3, 4, 5]
>>> [1,2,3][:5]
[1, 2, 3]
>>> x = [6,7,8,9,10,11,12]
>>> x[:5]
[6, 7, 8, 9, 10]
Posted by: Guest on August-13-2020

Code answers related to "cut a section out of a list python"

Python Answers by Framework

Browse Popular Code Answers by Language