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

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright ยฉ Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap