Answers for "what does colon do in arrays with python"

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 "what does colon do in arrays with python"

Python Answers by Framework

Browse Popular Code Answers by Language