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
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week