The method swapcase() returns a copy of the string in which all the case-based characters have had their case swapped.
NA
str.swapcase();
#!/usr/bin/python str = "this is string example....wow!!!"; print str.swapcase() str = "THIS IS STRING EXAMPLE....WOW!!!"; print str.swapcase()
When we run above program, it produces following result −
THIS IS STRING EXAMPLE....WOW!!! this is string example....wow!!!