Vidyalelo
Python · Q42

MCQs on Python Tuples: Exam

Programming · Python · question 42

Q42

What will be the output of the following Python code? >>> a=(0,1,2,3,4) >>> b=slice(0,2) >>> a[b]

A.
Invalid syntax for slicing
B.
[0,2]
C.
(0,1)
Answer
D.
(0,2)

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board