Conversion of String Characters to Lowercase in Python
In Python, you can convert all charcters of a string to lowercase using the str.lower()
method.
Converting all characters of a string to lowercase using 'str.lower()' method
1. Create a variable named str_variable
and assign string value "Python iS A proPramming Language."
to the variable.
2. Apply the lower()
method to the string variable str_variable
. This method converts all characters of the string to lowercase. Store the result in a new variable called lower_string
.
Please take a closer look at the following example:
Example of using lower() method
Output of the above example
python is a propramming language.