Computer Science, asked by akshu4391, 4 months ago

output of
L1 = [1,2,3,4,5,6,7,8,9,10]
delL1[3:]​

Answers

Answered by anindyaadhikari13
1

Required Answer:-

Correct Códe:

L1 = [1,2,3,4,5,6,7,8,9,10]

del L1[3:]

To Find:

  • The new list after modification.

Solution:

Given List,

>> L1 = [1,2,3,4,5,6,7,8,9,10]

→ del L1[3:] removes all the elements in the index range - 3 to 9 (last index is 9)

So, the newly modified list is -

>> L1 = [1,2,3]

Note that index value starts with zero. So, index value of 4 in the list is 3 and that of 10 is 9.

For verification, check out the attachment.

•••♪

Attachments:
Similar questions