Programming Examples
Python program to interchange the values of two tuple
Write a program to input any two tuples and interchange the tuple values.
Output/ Explanation:
Total number of values in first tuple3
enter elements10
enter elements20
enter elements30
Total number of values in second tuple4
enter elements100
enter elements200
enter elements300
enter elements400
Before SWAPPING
First Tuple ('10', '20', '30')
Second Tuple ('100', '200', '300', '400')
AFTER SWAPPING
First Tuple ('100', '200', '300', '400')
Second Tuple ('10', '20', '30')
Write a program to input any two tuples and interchange the tuple values.
Output/ Explanation:
Enter Tuple 1(1,2,3)
Enter Tuple 2(5,6,7,8)
Before SWAPPING
First Tuple (1, 2, 3)
Second Tuple (5, 6, 7, 8)
AFTER SWAPPING
First Tuple (5, 6, 7, 8)
Second Tuple (1, 2, 3)