In python, the string lower() method is useful to convert all the string characters to lowercase. Generally, the lower() method will convert all the uppercase letters in a string to lowercase. In case, if no uppercase letters in a string, it will return the original string.
Following is the pictorial representation of the string lower()
method functionality in python.
If you observe the above diagram, we are trying to convert the given string “Hi GUEST Hi
” to lowercase using the lower
function in python. The lower()
method has returned the string by converting all the string characters to lowercase.
Following is the syntax of defining a string lower method in python.
The python lower()
method will not accept any parameters.
Following is the example of converting the given string characters to lowercase using the string lower()
method in python.
If you observe the above example, we are converting the given string characters to lowercase using the lower()
method.
When you execute the above python program, you will get the result as shown below.
This is how you can use the string lower()
method in python to convert all the characters of the given string to lowercase based on your requirements.