Python String lower() Method

The lower() method returns the copy of the original string wherein all the characters are converted to lowercase. If no uppercase characters present, it returns the original string. Symbols and numbers remain unaffected by this function.

Syntax:

str.lower()

Parameters:

None

Return Value:

Returns a string in lower case.

The following example demonstrates converting string to lowercase.

Example:
mystr = 'HELLO WORLD'
mystr_lower = mystr.lower()       

print('Original String:', mystr)
print('New String:', mystr_lower)  
Output
Original String: Hello World
New String: hello world

The lower() method will ignore numbers and symbols. The following example converts a string with a number and symbol to lowercase.

Example:
mystr = '#1 HarBour sIDe'
print(mystr.lower())

numstr = '12345'
print(mystr.lower())

numstr = '123ABC'
print(mystr.lower()) 
Output
#1 harbour side
12345
123abc

The lower() method does not convert all the Unicode chars. For example, the German lowercase letter 'ß' is equivalent to 'ss'. Since it is already lowercase, the lower() method would not convert it; whereas the casefold() converts it to 'ss'.

Example:
mystr = 'außen'
print(mystr.casefold())

mystr = 'außen'
print(mystr.lower())
Output
aussen
außen
Want to check how much you know Python?