Q. Predict the output:


(i)

b = [[9,6],[4,5], [7,7]]

x = b[:2]

x.append (10)

print (x)


(ii)

b = [[9,6],[4,5],[7,7]]

x = b[:2]

x[1]. append (10)

print(x)


Answer =

(i)

Output:-

[[9, 6], [4, 5], 10]
>>>

(ii)

Output:-

[[9, 6], [4, 5, 10]]
>>>

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post