Python String lower() Method

The Python String lower() method converts all the case-based characters in a string into lowercased characters. However, for the strings containing only lowercased characters, it will not be converted and remains the same. This method is also exempt for strings containing number and symbol characters, as they are not case-based.

The lower() method is a counterpart for the upper() method - in which the letters will be uppercased as a result; and they are both applied in real-time, if we want to develop an application where case-sensitivity is not taken into consideration.


Following is the syntax for Python String lower() method −



This method does not accept any parameters.

Return Value

This method returns a copy of the string in which all case-based characters have been lowercased.


The string taken as the input has all uppercase letters, so the method returns the lowercased string as the result.

The following example shows the usage of Python String lower() method. Here, we are passing an uppercased string value as a parameter to this method.


When we run above program, it produces following result −

this is string example


If the input string taken has all lowercase letters, the method returns the original string as the result.

str = "this is a string";

The program above, on executing, displays the following result −

this is a string


When we take a numbered string as an input, the method returns the original string as the result.

In the following example, we assign a numbered string to the variable str. Then, we call the lower() method on this string.

str = "287193778190";

On executing the above program, the output is displayed as follows −



When we pass a symbol string as the input, the result produced by the method is the original string itself.

In this example program, we are creating a string with only symbols and calling the lower() method on it. The method will not modify the string, as it does not contain case-based characters.

str = "@#$%^&*(";

When we run above program, the following result is obtained −



In a non case sensitive environment, two strings are compared to see if they are equal using the lower() method. The return value will be either true or false.

In this example program, we creating two strings converting them to lower case using this method. Then, using the conditional statements, we check if both strings are equal after they are lowercased. The program prints "Both strings are equal" if they are equal and "Both strings are not equal" otherwise.

str2 = "STRING example"
if(str1.lower() == str2.lower()):
   print("Both strings are equal")
   print("Both strings are not equal")

The output for the program above is displayed as −

Both strings are equal