QuestionQ251

VerifiedFunctions and Exceptions

What is the expected output of the following code?

Question Image

Explanation

Slicing a three-element tuple from index 3 returns an empty tuple, while slicing from index -2 returns its last two elements. The loop adds both elements to new, so its length is 2.

Community Discussion

No comments yet. Be the first to start the discussion!