Computer Science, asked by Soozen, 10 months ago

write a python program to change the values of two variables​

Answers

Answered by karanjotgaidu
3

Answer:

#python program to change the values of two #variables

a = int(input('Enter value of 1 variable'))

b = int(input('Enter value of 2 variable'))

#exchanging values

a, b = b, a

print(a)

print(b)

___________________________________

#WMK

Answered by Equestriadash
5

The following codes will have to be typed in script mode, saved and then executed.

CODE:

a = input("Enter a value:")

b = input("Enter a value:")

print("The value of a is", a)

print("The value of b is", b)

a, b = b, a

print("The values after swapping are:")

print("a =", a)

print("b =", b)

OUTPUT:

Attachments:
Similar questions