Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Python Tutorial
  • Interview Questions
  • Python Quiz
  • Python Glossary
  • Python Projects
  • Practice Python
  • Data Science With Python
  • Python Web Dev
  • DSA with Python
  • Python OOPs
Open In App
Next Article:
Python String lstrip() Method
Next article icon

String lower() Method in Python

Last Updated : 28 Mar, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

lower() method in Python converts all uppercase letters in a string to their lowercase. This method does not alter non-letter characters (e.g., numbers, punctuation). Let’s look at an example of lower() method:

Python
s = "HELLO, WORLD!"  # Change all uppercase letters to lowercase res = s.lower() print(res) 

Output
hello, world! 

Syntax of lower() method

string.lower()

Parameters: This method does not take any parameters.

Return Type : returns a new string with all uppercase characters converted to lowercase. The original string remains unchanged since strings in Python are immutable.

Examples of lower()

Example 1. Case-Insensitive Comparison

lower() method is very useful in making case-insensitive comparisons between strings.

Python
s1 = "Python" s2 = "python"  if s1.lower() == s2.lower():     print("The strings are equal.") else:     print("The strings are not equal.") 

Output
The strings are equal. 

Explanation: In this example, we convert both s1 and s2 to lowercase using lower() before comparing them. This approach ensures that the comparison is not affected by case differences.

Example 2. Normalizing User Input

When dealing with user input, converting text to lowercase ensures uniformity, especially for tasks like comparing usernames or email addresses.

Python
e1 = "[email protected]" e2 = "[email protected]"  # Convert both to lowercase for comparison if e1.lower() == e2.lower():     print("Emails match.") else:     print("Emails do not match.") 

Output
Emails match. 

Explanation: lower() method converts both email addresses to lowercase, allowing a case-insensitive comparison. This is useful when checking if two email addresses are the same, regardless of how they were entered.

Example 3. Keyword Matching in Search

lower() helps in making search operations case-insensitive by converting both the search query and text to lowercase.

Python
s = "GFG is the best place to learn Python." k = "python"  # Convert both to lowercase for case-insensitive search if k.lower() in s.lower():     print("Keyword found!") else:     print("Keyword not found.") 

Output
Keyword found! 

Explanation: this code checks if the keyword “python” is present in the string s, regardless of case. By converting both s and k to lowercase using .lower(), the search becomes case-insensitive.

Example 4. Mixed Strings

Let’s take an example to illustrate how lower() method works on a string that includes non-alphabetic characters.

Python
s = "Hello, World! 123 @Python"  # Change only uppercase letters to lowercase res = s.lower() print(res) 

Output
hello, world! 123 @python 

Explanation: .lower() method converts all uppercase letters in the string s to lowercase, while special characters (!, @) and numbers (1,2,3) remain unchanged.



Next Article
Python String lstrip() Method

A

Akanksha_Rai
Improve
Article Tags :
  • Python
  • python-string
  • Python-string-functions
Practice Tags :
  • python

Similar Reads

  • Python String index() Method
    The index() method in Python is used to find the position of a specified substring within a given string. It is similar to the find() method but raises a ValueError if the substring is not found, while find() returns -1. This can be helpful when we want to ensure that the substring exists in the str
    2 min read
  • Python String isalnum() Method
    The isalnum() method is a string function in Python that checks if all characters in the given string are alphanumeric. If every character is either a letter or a number, isalnum() returns True. Otherwise, it returns False. For Example: [GFGTABS] Python s = "Python123" res = s.isalnum() pr
    2 min read
  • Python String isalpha() Method
    The isalpha() method checks if all characters in a given string are alphabetic. It returns True if every character in the string is a letter and False if the string contains any numbers, spaces, or special characters. Let’s start with a simple example of using isalpha() [GFGTABS] Python s1 = "H
    2 min read
  • Python string isdecimal() Method
    In Python, the isdecimal() method is a quick and easy way to check if a string contains only decimal digits. It works by returning True when the string consists of digits from 0 to 9 and False otherwise. This method is especially useful when we want to ensure that user inputs or string data are stri
    3 min read
  • Python String isdigit() Method
    The isdigit() method is a built-in Python function that checks if all characters in a string are digits. This method returns True if each character in the string is a numeric digit (0-9) and False otherwise. Example: [GFGTABS] Python a = "12345" print(a.isdigit()) b = "1234a5" pr
    3 min read
  • Python String isidentifier() Method
    The isidentifier() method in Python is used to check whether a given string qualifies as a valid identifier according to the Python language rules. Identifiers are names used to identify variables, functions, classes, and other objects. A valid identifier must begin with a letter (A-Z or a-z) or an
    3 min read
  • Python String islower() Method
    The islower() method in Python checks if all characters in a string are lowercase. It returns True if all alphabetic characters are lowercase, otherwise, it returns False, if there is at least one uppercase letter. Let's look at a quick example of using the islower() method. [GFGTABS] Python s =
    2 min read
  • Python String isnumeric() Method
    The isnumeric() method is a built-in method in Python that belongs to the string class. It is used to determine whether the string consists of numeric characters or not. It returns a Boolean value. If all characters in the string are numeric and it is not empty, it returns “True” If all characters i
    3 min read
  • Python String isprintable() Method
    Python String isprintable() is a built-in method used for string handling. The isprintable() method returns "True" if all characters in the string are printable or the string is empty, Otherwise, It returns "False". This function is used to check if the argument contains any printable characters suc
    3 min read
  • Python String isspace() Method
    isspace() method in Python is used to check if all characters in a string are whitespace characters. This includes spaces (' '), tabs (\t), newlines (\n), and other Unicode-defined whitespace characters. This method is particularly helpful when validating input or processing text to ensure that it c
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences