xxxxxxxxxx
>>>
>>> a = [1, 2, 4]
>>> print a
[1, 2, 4]
>>> b = a[:2] + [3] + a[2:]
>>> print a
[1, 2, 4]
>>> print b
[1, 2, 3, 4]
xxxxxxxxxx
a = ['a','b','c','d','e']
for i in range(len(a)):
a[i] = a[i] + " : Alphabet"
print(a[i])
xxxxxxxxxx
squares = [1, 4, 9, 16] sum = 0 for num in squares: sum += num print sum ## 30