GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — String lower() Method in Python - GeeksforGeeks String lower() Method in PythonLast 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.
Output hello world! Explanation: text.lower() converts all uppercase letters in text to lowercase. Spaces and punctuation marks remain unchanged. Syntax
ExamplesExample 1: In this example, lower() is used to convert all uppercase letters in a sentence to lowercase.
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().
Output code123@python! Example 3: In this example, lower() is used to normalize text entered in different letter cases.
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.
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.
Output True Explanation: text.lower() and word.lower() convert both strings to lowercase before performing the search. Comment Explore |
| 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. |