Post

@Python_Dv Output C) [9, 7, 5, 3, 0] — slicing with step -2 picks every 2nd element from the end.
English

@Python_Dv [::-2] means:
start from the end
move backwards
take every 2nd element
Ans---> A: [9, 7, 5, 3, 1]
English

@Python_Dv C) is the correct answer.
Here we are using concept of list slicing and [start:End:step_size] and step size is -2 so it reverse the list.
English

@Python_Dv A: [9, 7, 5, 3, 1]
[::-2] starts from the end and steps backward by 2.
Also, naming your variable "list" is the real crime here. Somewhere a Python built-in is crying 😂
English

















