Question 518: What is the value ofresultafter executing the following Python code?my_list = [1, 2, 3, 4, 5] result = my_list[::2]
tcs
wipro
infosys
general
aptitude
tricky-questions
python-programming
The slicing notationmy_list[::2]extracts elements with a step of 2, starting from index 0. Therefore, it includes elements at indices 0, 2, and 4, resulting in the list [1, 3, 5].