transformation
str.lower
Returns a copy of the string with all cased characters converted to lowercase. Uses Unicode simple lowercase mappings.
str.lower() Parameters
| Parameter | Purpose |
|---|---|
| self | operates on the calling string; takes no arguments |
| returns | new lowercased str (original unchanged — str is immutable) |
Examples
>>> 'Hello, World!'.lower()
'hello, world!' cased letters become lowercase
>>> 'PYTHON3'.lower()
'python3' digits unaffected
>>> 'STRAßE'.lower()
'straße' ß stays ß (unlike upper/casefold which expand it)
>>> 'ÄÖÜ'.lower()
'äöü' handles accented characters
Gotcha
For robust case-insensitive comparison prefer casefold() — lower() misses full Unicode folding (e.g. 'ß' vs 'ss', Turkish 'İ').
Related methods
str.upper
Returns a copy of the string with all cased characters converted to uppercase. Non-cased characters (digits, punctuation, whitespace) are unchanged.
str.casefold
Returns a casefolded copy suitable for caseless matching. Stronger than lower(): it applies full Unicode case folding, e.g. German 'ß' becomes 'ss'.
str.title
Returns a titlecased copy where the first letter of each word is uppercase and the rest are lowercase. Word boundaries are defined by any run of non-letter characters, including apostrophes.
str.replace
Returns a new string with all occurrences of substring old replaced by new. If count is given, only the first count occurrences are replaced.