Q. Given a list L1 = [3, 4.5, 12, 25.7, [2, 1, 0, 5], 88]


(a) Which list slice will return [12, 25.7, [2, 1, 0, 5]

(b) Which expression will return [2, 1, 0, 5]

(c) Which list slice will return [2, 1, 0, 5]

(d) Which list slice will return [4.5, 25.7, 88]



Answer =

(a)
>>> L1[ 2 : 5]

(b)
>>> L1[4]

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

(d)
>> L1[1: :2]

Post a Comment

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

Previous Post Next Post