Wednesday, 3 July 2019

Python program on swapping the two values

#Python program on swapping the two values
a=2
b=3
print("Before swapping")
print("a=",a)
print("b=",b)

temp=a
a=b
b=temp
print("After Swapping")
print("a=",a)
print("b=",b)

output:
Before Swapping
a=2
b=3
After Swapping
a=3
b=2

No comments:

Post a Comment

Files with Exception handling

#Ask the user to take two input integer values var a,b try:     a=int(input("enter any integer value:"))     b=int(input(...