python string lower method

Python String lower() method

The python String lower() method is used to convert the uppercase string into lowercase.

Python String lower() method Syntax :


In the above syntax, the string is a value or string variable that you want to convert in lowercase. Python’s lower() method does not take any argument.

lower() string method in python

Below are the different types of examples of the python lower() method.

Example 1:


Output :

hello coders

Example 2:

str="hello coders"

Output :

hello coders

Hence, if the string is already in lowercase then it will change nothing.

Example 3:

str="Hello Coders"
print (str.lower()) 

Output :

hello coders

Example 4:

str="HeLLo CoDers"
print (ans)

Output :

hello coders

Example 5:

str="Be you"
str. lower() 
print (str) 

Output :

Be you

As you can see, the above output is still the same because we can not change the existing string. But if we print the, str. lower () then it will print the ‘be you’.

Discover Our Exciting Courses and Quiz

Enroll now to enhance your skills and knowledge!

Python Online Quiz

Level up your coding skills with our interactive programming quiz!