Q. Given a list L1 = [3, 4.5, 12, 25.7, [2, 1, 0, 5], 88] which function can change the list to:


(a) [3, 4.5, 12, 25.7, 88]

(b) [3, 4.5, 12, 25.7]

(c) [[2, 1, 0, 5], 88]


Answer =

(a)
>>> L1.pop (4)
Or
>>> del L1 [4]

(b)
>>> del L1 [4:]

(c)
>>> del L1[0:4]

7 Comments

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

Post a Comment

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

Previous Post Next Post