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

Basic useTry it yourself
print("Hello WORLD".lower())

Output

hello world
Case-insensitive input checkTry it yourself
answer = "YES"
if answer.lower() in ("y", "yes"):
    print("confirmed")

Output

confirmed

For case-insensitive comparisons across languages, prefer casefold().

Version history

VersionChange
Python 3.0Added