Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?

a) print(list1[2:])
b) print(list1[:2])
c) print(list1[:-2])
d) all of the mentioned

Answer: d
Explanation: Slicing is allowed in lists just as in the case of strings.

Join The Discussion