به این شکل عمل کنین :
a[start:end] # items start through end-1
a[start:] # items start through the rest of the array
a[:end] # items from the beginning through end-1
a[:] # a copy of the whole array
a[start:end:step] # start through not past end, by step
مثلا
str='string'
print(str[-3:]) #ing
print(str[:3]) #str
print(str[1:4])#tri
ضمنا داخل پایتون اندیس منفی یعنی از اخر به اول پس [: 3-] یعنی از سومین حرف از آخر تا پایان رشته .