In this tutorial, We will see the python string lower() method with examples.
lower() Method
The lower() method is one of the methods in a python string. The lower() method is used for string conversion.
The lower() method converts the string into lowercase.
- The lower() method converts uppercase characters to lowercase characters.
- If the character is in the already lower case then applying the lower method will not bring any change.
Syntax of Python string lower() method
This is the syntax of the python string lower() method.
string.lower()
Example of Python string lower() method
#Example 1 text = "PYTHON IS A PROGRAMMING LANGUAGE" #Convert text into lower character. print(text.lower()) #output : python is a programming language
#Example 2 text = "CONVERT INTO UPPERCASE, PYTHON UPPER METHOD" #Convert text into lower character. print(text.lower()) #output: convert into lowercase, python lower method #Exmaple 3 message = "HELLO WORLD!" #Convert message into lower character. msg = message.lower() print(msg) #output: "hello world!"
Program: Take a string from user input and convert it into lowercase.
message = input("Enter the message") msg = message.lower() print(msg)
Related Posts