Python’s string type provides many functions that act on the capitalization of a string. These include :

With unicode strings (the default in Python 3), these operations are not 1:1 mappings or reversible. Most of these operations are intended for display purposes, rather than normalization.

str.casefold()

str.casefold creates a lowercase string that is suitable for case insensitive comparisons. This is more aggressive than str.lower and may modify strings that are already in lowercase or cause strings to grow in length, and is not intended for display purposes.

"XßΣ".casefold()
# 'xssσ'

"XßΣ".lower()
# 'xßς'

The transformations that take place under case folding are defined by the Unicode Consortium in the CaseFolding.txt file on their website.

str.upper()

str.upper takes every character in a string and converts it to its uppercase equivalent, for example:

"This is a 'string'.".upper()
# "THIS IS A 'STRING'."

str.lower()

str.lower does the opposite; it takes every character in a string and converts it to its lowercase equivalent:

"This IS a 'string'.".lower()
# "this is a 'string'."

str.capitalize()

str.capitalize returns a capitalized version of the string, that is, it makes the first character have upper case and the rest lower: