pythonstringuppercaselowercase

How do I lowercase a string in Python?


Is there a way to convert a string to lowercase?

"Kilometers"  →  "kilometers"

See How to change a string into uppercase? for the opposite.


Solution

  • Use str.lower():

    "Kilometer".lower()