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])
  1. Yes
  2. 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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.