How do I lowercase a string in Python?
You can use the lower() method to lowercase a string in Python.
You can use the lower() method to lowercase a string in Python. Here is an example:
Lowercase a string in Python
python— editable, runs on the server
Info
Watch a video course: Python - The Practical Guide
This will output hello world. Note that the lower() method does not modify the original string; it returns a new string with all the characters in lowercase. The following example demonstrates that the original string remains unchanged:
Lowercase a string in Python and printing the original string which remains unchanged
python— editable, runs on the server
This will output HELLO WORLD.