What will be the output of the following Python code?
>>>t=(1,2,4,3)
>>>t[1:3]
a) (1, 2)
b) (1, 2, 4)
c) (2, 4)
d) (2, 4, 3)
Answer: c
Explanation: Slicing in tuples takes place just as it does in strings.
Related Posts
Which was one of the first security subsets proposed?
Which is the object that defines methods that allow complete control over page content?
Which are the two functions that are not allowed in any secure subset?
Why is “this” keyword not preferred in JavaScript?
Which is the subset that is a secure container designed for the purpose of safely running untrusted JavaScript?
Why was “The Good Parts” designed as a language subset in JavaScript?
What is being imposed on each subset to ensure that it conforms to the subset?
Join The Discussion