I’ve a basic problem in understanding how python selects elements from below script?
myList = ['a', 'b, 'c', 'd', 'e', 'f', 'g', 'h'] start = 1 end = 5 print myList[ start : end ]
O/P ==> ['b, ‘c’, ‘d’, ‘e’]
During starting point i.e.
start = 1 python selects element ‘b’ from the list because ‘b’ item is at 1st index point of list.
For end i.e.
end = 5 why python selects element ‘e’, where python index starts from zero, then if we count from zero then fifth index point element should be ‘f’, right?
For end element i.e.
end=5, does python starts counting from 1 rather than 0?!