#!/usr/bin/python
list2 = ['Bangalore','Cochin','Trivandrum','Auckland','Seoul','Los Angeles']
list2[5] = 'Hamilton'
list2.append('Sydney')
list2.append('San Jose')
list2.append('Amsterdam')
print "Cities = ",list2[0:(len(list2) - 1)]
print "Cities = ",list2[0:(len(list2))]
The first print statement does not print the last element in the list.The second print statement does print all the elements in the list without an out of bounds errors.From the documentation I understand len() simply returns the number of elements in the list.Then why is the last index not len(list) - 1