Python - String Method - swapcase() Tutorial
It swap (convert) all the uppercase character to lowercase and lowercase character to uppercase in the given string. It does not modify the original string.
str1 = "WELcome To fresherBELL PYTHON TUTOrial"
print(str1.swapcase())
print(str1)
Output-
welCOME tO FRESHERbell python tutoRIAL
WELcome To fresherBELL PYTHON TUTOrial
In the above program, it swaps all the upper case characters to lower case and all the lower case characters to upper case of the string str1. But, it does not modify the original string.