Categories
Python Answers

How to convert a string to lower case in Python?

Spread the love

Sometimes, we want to convert a string to lower case in Python.

In this article, we’ll look at how to convert a string to lower case in Python.

How to convert a string to lower case in Python?

To convert a string to lower case in Python, we can call the string’s lower method.

For instance, we write:

s = "Kilometer"
print(s.lower())

We call s.lower to return "Kilometer" with all lower case characters.

Therefore, 'kilometer' is printed.

Conclusion

To convert a string to lower case in Python, we can call the string’s lower method.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *