GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Python Tutorial
  • Data Types
  • Interview Questions
  • Examples
  • Quizzes
  • DSA Python
  • Data Science
  • NumPy
  • Pandas
  • Practice
  • Django
  • Flask
  • Introduction1 min read
  • Input & Output2 min read

This view

  • Original page
  • New address

GeezerVison is showing www.geeksforgeeks.org — String lower() Method in Python - GeeksforGeeks

geeksforgeeks
search icon
  • Courses
  • Tutorials
  • Interview Prep
  • Python Tutorial
  • Data Types
  • Interview Questions
  • Examples
  • Quizzes
  • DSA Python
  • Data Science
  • NumPy
  • Pandas
  • Practice
  • Django
  • Flask

String lower() Method in Python

Last Updated : 27 Jul, 2026

lower() method converts all uppercase letters in a string to lowercase. It returns a new string and does not modify the original string because strings are immutable. Characters that are already lowercase, as well as digits, spaces and symbols, remain unchanged.

Example 1: In this example, lower() converts all uppercase letters in the string to lowercase.

Python
text = "HELLO World!"
print(text.lower())

Output
hello world!

Explanation: text.lower() converts all uppercase letters in text to lowercase. Spaces and punctuation marks remain unchanged.

Syntax

string.lower()

  • Parameters: This method does not take any parameters.
  • Return Value: Returns a new string with all uppercase letters converted to lowercase.

Examples

Example 1: In this example, lower() is used to convert all uppercase letters in a sentence to lowercase.

Python
msg = "WELCOME TO PYTHON"
print(msg.lower())

Output
welcome to python

Example 2: In this example, the string contains letters, numbers and special characters. Only the alphabetic characters are affected by lower().

Python
text = "CODE123@PYTHON!"
print(text.lower())

Output
code123@python!

Example 3: In this example, lower() is used to normalize text entered in different letter cases.

Python
city = "NeW YoRK"
print(city.lower())

Output
new york

Case-Insensitive Comparison Using lower()

When comparing strings, differences in letter case can produce incorrect results. Converting both strings to lowercase ensures a case-insensitive comparison.

Example 1: In this example, two strings with different letter cases are compared after converting both to lowercase.

Python
a = "Python"
b = "PYTHON"
print(a.lower() == b.lower())

Output
True

Explanation: a.lower() and b.lower() both become "python", so the comparison returns True.

Example 2: In this example, a keyword is searched within a sentence without worrying about letter case.

Python
text = "Learn Data Science With PYTHON"
word = "python"
print(word.lower() in text.lower())

Output
True

Explanation: text.lower() and word.lower() convert both strings to lowercase before performing the search.

Comment

Explore

    Python Fundamentals
    • Introduction1 min read
    • Input & Output2 min read
    • Variables4 min read
    • Operators4 min read
    • Keywords2 min read
    • Data Types4 min read
    • Conditional Statements3 min read
    • Loops3 min read
    • Functions4 min read
    Python Data Structures
    • String4 min read
    • List3 min read
    • Tuples3 min read
    • Dictionary3 min read
    • Set2 min read
    • Arrays5 min read
    Advanced Python
    • OOP Concepts3 min read
    • Exception Handling5 min read
    • File Handling4 min read
    • Python Database2 min read
    • MongoDB3 min read
    • MySQL7 min read
    • Packages4 min read
    • Modules3 min read
    • DSA Libraries5 min read
    • Python GUI2 min read
    Data Science with Python
    • Numpy3 min read
    • Pandas4 min read
    • Matplotlib3 min read
    • Seaborn3 min read
    • StatsModel2 min read
    • Model Building6 min read
    • TensorFlow2 min read
    • PyTorch5 min read
    Web Development with Python
    • Flask3 min read
    • Django5 min read
    • Django ORM4 min read
    • Jinja2 Templating5 min read
    • Django Templates5 min read
    • REST API3 min read
    • Build API with DRF4 min read
    Python Practice
    • Quiz1 min read
    • Practice Problems2 min read
    • Interview Q & A15+ min read
    Courses
    • Placement 360 Course2 min read
    • Data Science 360 Course2 min read
    • AI Engg Course2 min read
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.