Categories
Python Answers

How to convert a string to lowercase in Python?

Spread the love

Sometimes, we want to convert a string to lowercase in Python.

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

How to convert a string to lowercase in Python?

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

For instance, we write:

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

And we see 'kilometer' logged.

Conclusion

To convert a string to lowercase in Python, we can use the Python 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 *