aList = [123, 'xyz', 'zara', 'abc']
aList.append(2014)
print aList
which produces o/p [123, 'xyz', 'zara', 'abc', 2014]
What should be done to overwrite/update this list. I want the o/p to be
[2014, 'xyz', 'zara', 'abc']
You may try this
alist[0] = 2014
but if you are not sure about the position of 123 then you may try like this:
for idx, item in enumerate(alist):
if 123 in item:
alist[idx] = 2014