Python String swapcase() MethodPython swapcase() method converts case of the string characters from uppercase to lowercase and vice versa. It does not require any parameter and returns a string after case conversion. SignatureParametersNo Parameter ReturnIt returns a string. Let's see some examples of swapcase() method to understand it's functionality. Python String swapcase() Method Example 1It is a simple example to convert uppercase to lowercase using the swapcase() method. Output: hello javatpoint Python String swapcase() Method Example 2This example describes conversion from lowercase to uppercase. Output: HELLO JAVATPOINT Python String swapcase() Method Example 3If the string is in camelcase, the output of this method also would be in camelcase. All the lowercase will be converted to uppercase and vice versa. Output: hELLO jAVtPOINT Next TopicPython Strings |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India