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

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

t1=([22,1,2,3],)
print(t1*2)
  1. ([22, 1, 2, 3], [22, 1, 2, 3])
  2. ([44,1,4,6])
  3. Error
  4. Not defined

Answer: A) ([22, 1, 2, 3], [22, 1, 2, 3])

Explanation:

When you multiply any integer with the tuple it repeats the elements of the tuple that number of times.

Comments and Discussions!

Load comments ↻






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