28: Program to Lowercase a String in Python

To Lowercase a String in Python you can make use of the built-in lower() method from the String class.

Let's take a look at an example.


Example 1:
input_string = "Code2care - Line's of code for change!"
lowercase_string = input_string.lower()
print(lowercase_string)
Output:
code2care - line's of code for change!

Documentation:

str.lower(): https://docs.python.org/3/library/stdtypes.html#str.lower

Return a copy of the string with all the cased characters converted to lowercase.


Example 2:
Python Program Lowercase String

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!