Home »
Python »
Python Tuples MCQs
will the fourth index element will be included in the result?
20. will the fourth index element will be included in the result?
Suppose you have the following code,
t1=("hello","everyone","include helps","welcomes","you","all")
print(t1[2:4])
- Yes
- No
Answer: B) No
Explanation:
No, the fourth index element will not be included in the result, as the slicing operator only works for the end-1 index, that means in this case it will work only till the third index.