How to use the Python string lower() Method?
To convert all characters of a string to lowercase just call the lower() function with the string. lower() function is an in-built string method and can be used with variables as well as strings. Let’s understand it better with an example:
Python3
string = "HelloWorld" print (string.lower()) print ( "HelloWorld" .lower()) |
Output
helloworld
helloworld
Python String lower() Method
Python string lower() method converts all letters of a string to lowercase. If no uppercase characters exist, it returns the original string.
Example:
Python3
string = "ConvErT ALL tO LoWErCASe" print (string.lower()) |
Output
convert all to lowercase