How to Convert String to Lowercase in Python

Channel: Linux
Abstract: Some times you may require to convert any string to lower case (all letters). This tutorial will help to convert a string (any case) to lower case as

Some times you may require to convert any string to lower case (all letters). This tutorial will help to convert a string (any case) to lower case as showing in the below image.

Convert String to Lower Case

Using Python programming language you can use .lower() function to convert any string to lower case. Here is the sample Python code to convert string to lower case.

>>> s = "HeLLo Python" >>> print(s.lower()) hello python1234>>> s = "HeLLo Python">>> print(s.lower()) hello python

Suggested reading

Some more examples of the string conversions in Python.

  • Convert String to Uppercase in Python
  • Python Convert String to Lowercase

Ref From: tecadmin
Channels: Python

Related articles