+3 votes
in Class 12 by kratos

Write a program to input any two tuples and interchange the tupel values.

1 Answer

+5 votes
by kratos
 
Best answer

t1 = tuple( )

n = input(“Total number of values m first tuple”) for i in range (n):

a = input(“Enter elements”)

t2 = t2 + (a, )

print “First tuple”

print t1

print “Second tuple”

print t2

t1, t2 = t2, t1

print “After swapping”

print “First tuple”

print t1

print “Second tuple”

print t2

...