Advertisement



< Prev
Next >



Python - String swapcase() Method



The swapcase() string method is used to swap the cases of characters in a string, i.e. from lowercase to uppercase or from uppercase to lowercase.

Note : None of the string methods change the original string and only return a new string which reflects the change performed by the string method, hence the returned string must be stored or used(if needed to reflect the result), otherwise it is lost.



Signature of swapcase()


The swapcase() method has no parameters, so we don't have to worry about passing it some value.

# Signature of swapcase() method 
swapcase()




Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement

Notifications



Please check our latest addition

PYTHON


Advertisement