Q:

swapping in python

x = 5
y = 10

x, y = y, x
print("x =", x)
print("y =", y)
8
a=5
b=10
a,b=b,a  #swapped 
4
Python string | swapcase()
The string swapcase() method converts all uppercase characters to 
lowercase and vice versa of the given string, and returns it. 
Here string_name is the string whose cases are to be swapped.
Parameter: The swapcase() method does not takes any parameter.
2

New to Communities?

Join the community