×

Python String Lowercase

Python

Python is an interactive and more accessible language than any other programming language. The python programming language uses a variety of libraries to perform the operations in a faster way. The python language can also be used in web development; Django and Flask are the frameworks used to create web applications using Python. In Python, indentation is the main concept; if we do not follow proper indentation, the code may not run. We can easily create an application in Python if we are familiar with indentation, Variables, Operators, loop concepts and function concepts in python language.

Functions in Python

The methods in the python programming language are used to reduce the length of the code, and it will help reduce the time complexity of the code. Python programming contains built-in functions; these built-in functions will perform the operation already pre-installed inside the method; this method will operate when the method or function is called inside the code.

The function is generally a block of code to perform the required operation. We can pass the data inside the function as the parameter; these parameters will act as the input inside the function to perform the required operation. The function will return the final data after performing the required operation. The function is created in a python programming language with the help of the def keyword. Python programming also consists of the recursive function; a function calling itself is known as the recursion.

Python String Lowercase( )

The lowercase( ) function converts the given Data into the lowercase. This function will convert all the uppercase characters present in the given Data into lowercase characters and returns the data converted into the lowercase. The lowercase function is a built-in function provided by the python programming language. This function consists of a set of codes written inside it, and this function will return the data, which is converted into lowercase as the output. The lowercase( ) function does not take any parameter as the input, but it will return the data, which consists of the data in which all the characters are in lowercase.

Syntax:

String_name.lower( )

Parameters:

The lower case function does not take any parameters as the input, but in return, it will return the data, which consists of the data in which all the characters are converted into lowercase.

Example 1:

Let us consider an example of the data consisting of the characters in uppercase. Still, when we use the lowercase( ) function, it will convert the characters present in the data into lowercase.

Code:

#input the Data
data = 'Built-in Function' 
#display the original Data
print(‘Original data:’)
print(data)
#Calling the lower( ) function
#Converting the data into the lowercase
print(‘data converted into the lowercase:’)
print(data.lower( ))

Output:

Original data:
Built-in Function
Data converted into lowercase:
built-in function 

Example 2:

The lower case( )function will only convert the text inside the given Data, but it will not convert the numerical data inside the given test; the numeric data present inside the text will not affect the lower case( ) function.

Code:

data = ‘PUma 5h03s’
#displaying the original Data
print(‘Original data:’)
print( data)
#Calling the lower( )function
#Converting the data into the lowercase
print('Data converted into the lowercase:')
print(data.lower( ))

Output:

Original data:
Puma 5h03s


Data converted into lowercase:
puma 5h03s

Application of Lower( ) Function

The lower case () function is the primary application of the lower case () function, which is generally used to compare the Data whether both given data are the same or different. For this, first, we need to convert both the given Data into the lower case, then we need to compare both the data, whether they are the same or different, with the help of the equivalent operator.

Example:

#input of the Data
Data_1 = ‘buiLt In Function’
Data_2 = ‘BuIlt In FuNcTion’


#Calling the lower( )function
#Comparing the given Data
#displaying whether the given Data is the same or different
if(data_1.lower( ) == data_2.lower( )):
           print("Both the given data are the same")
else:
       print(“Both the given data are different”)

Output:

Both the given data are the same

Here we can observe that we have first converted the data into the lowercase, then compared both the data, and then displayed whether the given data are similar or different.


Related Topics

Get index of element in array in python

Index : Index is a number where the element is located in the given list. In other words it is the position of the element in the list. Index can also...

4 minutes read.

Python Os sep

Python: Python is an interactive and more accessible language than any other programming language. The python programming language uses a variety of libraries to perform the operations in a faster way....

3 minutes read.

Python delattr() function

Python delattr() function The delattr() function in Python is used to delete the named attribute from the object, with the prior permission of the object. Syntax delattr(object, name) Parameter object : This parameter represents the object from which...

1 minute read.

iobase Python

All I/O flow classes derive from this conceptual base class. Derived classes will have to execute several of the class's abstract data types. The loop method is supported by all members of...

4 minutes read.

Linear Regression using Sklearn with Example

This article will examine Python's global, local and non-local variables and show you how to use them to write code without problems. Let's quickly review what a variable in Python is...

8 minutes read.

String indices must be integers in Python

Lists, tuples, and strings are examples of iterable objects in Python whose items or characters can be retrieved by their index numbers. For instance, you might take the following action to...

3 minutes read.

SKLearn Linear Module

The SK learn linear module is one such module that helps to study the relationship between the independent and dependent variables.The linear module can be implemented by using the best...

3 minutes read.

Data Distribution in python

Before discussing data distribution, we will discuss each word that is data and Distribution. What is meant by data? A collection of raw facts and figures is called data. The word "raw"...

18 minutes read.

Number pattern in Python

Number pattern in Python: This article explains how to print number patterns in Python. The FOR loop, while loop, and range() functions are used in the following Python programs to...

4 minutes read.

Conditional Expressions in Python

In Python conditional expression are sometimes referred to operator called as ternary operator. Not only Python supports ternary operator but many other programming languages supports it. Ternary operator are the...

2 minutes read.

Python Breakpoint

Introduction In Python 3.7, a brand-new created function called breakpoint() was added. Due to the close relationship between both the executable and the code of a debugging component, debugging Python programming...

4 minutes read.

Python Bubble Sort

Bubble sort is one of the techniques used to sort the elements in lists in a certain order, either in ascending or descending order. It is called Bubble sort because...

4 minutes read.

Make Notepad using Tkinter in Python

Tkinter: The standard Python technique for building Graphical User Interfaces (GUIs) is Tkinter, which is included in all popular Python distributions. The only framework included in the Python standard library is...

5 minutes read.

Python Glob

Methods for matching files that include particular patterns in accordance with UNIX shell-related expansion rules are referred to as "glob" methods. Similar methods for finding, locating, and searching for all of...

12 minutes read.

Python List sort() method

The list.sort () method in Python sorts the items of the list in place. Syntax list.sort(key=None, reverse=False) Parameter reverse: If a Boolean value ‘True’ is passed, the  sorting will be done in the descending order else for ‘False’...

2 minutes read.

How to Open a file in python with Path

In this tutorial, we will see rather than the traditional way of opening a file by locating or navigating it from our desktops; we will learn how to open the...

2 minutes read.

AES CTR Python

Python Programming Language  Python is an interactive and more accessible language than any other programming language. The python programming language uses a variety of libraries to perform the operations in a...

3 minutes read.

Python Set add() Method

Python Set add() Method The set.add() method adds the specified element to a set. If the element is already present in the set, it doesn't add it. Syntax set.add(element) Parameter element- This parameter represents the element that...

1 minute read.

Python list() | List class in Python

The list() class in Python creates a list object where the list object is a collection which is ordered and changeable. Syntax class list([iterable]) Parameter Iterable: It is a required parameter which represents a sequence, collection...

1 minute read.

How to read data from com port in python

Comport, the I/O interface is known as a COM port that allows the connection for a serial device to a computer. COM ports are sometimes referred to as serial ports....

3 minutes read.