1.

Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?(a) print(list1[0])(b) print(list1[:2])(c) print(list1[:-2])(d) all of the mentioned

Answer» Right answer is (d) all of the mentioned

The explanation: Slicing is allowed in lists just as in the case of strings.


Discussion

No Comment Found