How to lowercase a string in Python?

Spread the love

Problem –

You want to lowercase a string in python.

Solution –

To lowercase a string in python you can use the lower() method.

In [1]: string1 = 'WE LOVE PYTHON'

In [2]: string1.lower()
Out[2]: 'we love python'

In [3]: string2 = 'We Love Python'

In [4]: string2.lower()
Out[4]: 'we love python'

Rating: 1 out of 5.

Leave a Reply