In python what will be its output
tuple1 = (2,4,3)
tuple3 = 1*2
print(tuple3)
Answers
Answered by
1
tuple1=(2,4,3)
tuple3=tuple1*2
print(tuple3)
> (2, 4, 3, 2, 4, 3)
In this code,
> tuple1 = (2,4, 3)
Now, tuple1 is multiplied with 2 and it is stored in tuple3.
Whenever a tuple with any number n, it gets repeated n times.
Here, tuple1 is multiplied with 2. So it repeats 2 times.
Hence,
> tuple3 = (2, 4, 3, 2, 4, 3)
Which is displayed on the screen.
Similar questions