Python 3 reference · String Methods
Python String lower() Method
Return a copy of the string with all cased characters converted to lower case.
Python 3 Since 3.0
Syntax
str.lower()
Return value
A new string.
Examples
print("Hello WORLD".lower())
Output
hello world
answer = "YES"
if answer.lower() in ("y", "yes"):
print("confirmed")
Output
confirmed
For case-insensitive comparisons across languages, prefer casefold().
Version history
| Version | Change |
|---|---|
| Python 3.0 | Added |
Related
str.upper()· Return a copy of the string with all cased characters converted to upper case.str.casefold()· Return a case-folded copy for caseless comparison. Stronger than lower(): it also handles special cases like German ß.str.islower()· Return True if all cased characters are lower case and there is at least one cased character.str.swapcase()· Return a copy with upper-case letters converted to lower case and vice versa.- Python Strings · tutorial