Computer Science

What will be the output of following Python code?

tp1 = (2,4,3)  
tp3 = tp1*2   
print(tp3)
  1. (4,8,6)
  2. (2,4,3,2,4,3)
  3. (2,2,4,4,3,3)
  4. Error

Python Tuples

4 Likes

Answer

(2,4,3,2,4,3)

Reason — The "*" operator repeats a tuple specified number of times and creates a new tuple.

Answered By

2 Likes


Related Questions