Answers for "array python generate with 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

Python Answers by Framework

Browse Popular Code Answers by Language