Answers for "how to call all the elements in an array in python by using colon"

1

colon in array python

>>> a=[1,2,3,4,5]
>>> a[1:3]
[2, 3]
>>> a[:3]
[1, 2, 3]
>>> a[2:]
[3, 4, 5]
>>> s='computer'
>>> s[:3]
'com'
>>> s[3:6]
'put'
Posted by: Guest on May-12-2020

Code answers related to "how to call all the elements in an array in python by using colon"

Python Answers by Framework

Browse Popular Code Answers by Language