1.

If a=(1,2,3,4), a[1:-1] is _________(a) Error, tuple slicing doesn’t exist(b) [2,3](c) (2,3,4)(d) (2,3)This question was addressed to me in an internship interview.I'd like to ask this question from Tuples in portion Tuples and Sets of Python

Answer»

Right choice is (d) (2,3)

Easy explanation - Tuple SLICING EXISTS and a[1:-1] returns (2,3).



Discussion

No Comment Found

Related InterviewSolutions