Summary: in this tutorial, you’ll learn how to use the Python String lower() method to return a copy of a string with all characters converted to lowercase.
Introduction to the Python String lower() method #
The lower() is a string method that allows you to return a copy of a string with all characters converted to lowercase.
The following shows the syntax of the lower() method:
str.lower()Code language: Python (python)The lower() method has no parameters.
Note that the lower() method doesn’t change the original string. It just returns a copy of the original string with all characters converted to lowercase.
If you want to return a copy of a string with all characters converted to uppercase, you use the string upper() method.
Python String lower() method example. #
The following example shows you how to use the lower() method to return a copy of a string with all characters converted to lowercase:
s = 'Python Lowercase'
new_s = s.lower()
print(s)
print(new_s)Code language: Python (python)Output:
Python Lowercase
python lowercaseCode language: Python (python)Summary #
- Use the Python string
lower()method to return a copy of a string with all characters converted to lowercase.