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

35. What will be the output of the following code?

t1=("hello","hi",[100,1000,10000])
t1[2][1]=2000
print(t1)
  1. It will show you the error as tuples are immutable
  2. It will change Hi to 2000
  3. ('hello', 'hi', [100, 2000, 10000])
  4. ('hello', '2000', [100, 2000, 10000])

Answer: C) ('hello', 'hi', [100, 2000, 10000])

Explanation:

Tuples are immutable but if there is any list inside a tuple then you can easily update the value of that list or mutable data type.

Comments and Discussions!

Load comments ↻






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