What will be the output of the following code? | Tuples Que. 16

16. What will be the output of the following code

T1=("hello","include help",-1)
print(T1[-1])
  1. Error
  2. Hello
  3. -1

Answer: c) -1

Explanation:

Negative index will access the element from the last element there -1 index means the last element of the tuple which means -1 is the answer.

Comments and Discussions!

Load comments ↻






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