Copyright © tutorialspoint.com
This method returns a copy of the string in which all the case-based characters have had their case swapped.
str.swapcase(); |
Here is the detail of parameters:
NA
It returns a copy of the string in which all the case-based characters have had their case swapped.
#!/usr/bin/python str = "this is string example....wow!!!"; print str.swapcase(); str = "THIS IS STRING EXAMPLE....WOW!!!"; print str.swapcase(); |
This will produce following result:
this is string example....wow!!! |
Copyright © tutorialspoint.com