Python String lower Method - Python Tutorial | Logic Practice
Python Course / Other / Python String lower Method

Python String lower Method

BLUF: This lesson on Python String lower Method provides a comprehensive guide to understanding and implementing this concept in Python. Whether you're a beginner or looking to refresh your knowledge, you'll find clear explanations and interactive code examples here.
Key Concept: Python String lower Method

Mastering Python String lower Method is essential for building efficient Python applications. Focus on the syntax and the best practices highlighted in this tutorial.

Python lower

Python String lower Method

The Python lower function generates a new string in which all the characters have been transformed to lowercase.

Syntax of Python String lower Method

It has the following syntax:

Example

lower()

Parameters

No parameter.

Return

It returns a lowercase string.

Different Examples for Python String lower Method

Let's examine a few examples of the lower method to gain a clearer understanding of its capabilities.

Example 1

Here is a straightforward illustration demonstrating the process of transforming a string into its lowercase equivalent.

Example

# Python lower() method example

# Variable declaration

str = "Example"

# Calling function

str = str.lower()

# Displaying result

print(str)

Output:

Output

logicpractice

Example 2

A string can vary in its composition and may contain letters in any case. This method will produce and return a new string that is entirely in lowercase.

Example

# Python lower() method example

# Variable declaration

str = "Welcome To HELLOworldvisualizer, WWW.logic-practice.com"

# Calling function

str = str.lower()

# Displaying result

print(str)

Output:

Output

welcome to logicpractice, www.logic-practice.com

Example 3

We can verify if it returns lowercase by employing an if statement. Refer to the example provided below.

Example

# Python lower() method example

# Variable declaration

str = "LOGICPRACTICE"

# Calling function

if str.lower() == "logicpractice":

    print("lowercase")

else:

    print("not lowercase")

Output:

Output

lowercase

Input Required

This code uses input(). Please provide values below:

Logic Practice
Install Logic Practice
Add to home screen for a faster app-like experience