Python Function Reference

str.lower

Convert all letters of the string to lowercase.

Python 3.13
str.lower()

Return value

A new string; the original is not changed.

Examples

Converting to lowercase

Python 3.13
print('HELLO'.lower())
hello

Case-insensitive comparison

Python 3.13
answer = 'Yes'
print(answer.lower() == 'yes')
True

Details

For case-insensitive comparison, str.casefold is more reliable: it handles special cases such as the German ß.

See also

Where to learn