write down the python program to exchange the values of two variables
Answers
Answered by
0
Answer:
t1 = tuple( )
n = int(input('Total number of values in first tuple:'))
for i in range (n):
a = input('Enter elements:')
t1 = t1 + (a, )
t2=tuple( )
m = int(input('Total number of values in second tuple:'))
for i in range (m):
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)
.
.
.
HOPE IT HELPED YOU
PLS MARK BRAINLIEST PLZ PLZ PLZ ...
Answered by
2
Answer:
hello,
Explanation:
#python program to exchange the values of two variables
a=eval(input("enter the value"))
b=eval(input("enter the value"))
print("before swapping")
print("a="=a,"b=",b)
print("after swapping")
print("a="=b,"b=",a)
hope it helps you
please mark brainliest
@ItzSnowySecret07
Similar questions
Business Studies,
2 months ago
Computer Science,
2 months ago
English,
2 months ago
Math,
4 months ago
Math,
4 months ago
Math,
9 months ago
English,
9 months ago