Python Glossary Русский

all Python 3Strings (str)function

str.lower

case

Return a copy with all cased characters converted to lowercase.

Syntax

s.lower()

Strings are immutable: lower() returns a new string and leaves the original untouched, so the result has to be assigned or used right away or the call is wasted. For caseless comparison of Latin and Cyrillic text lower() is enough, but with letters like German ß casefold() is the safer choice.

Examples

print('HELLO'.lower())     # → hello
print('ПРИВЕТ'.lower())    # → привет
print('Hello World'.lower())  # → hello world

See also

Open in the full glossarydocs.python.orgReport an inaccuracy