Isdigit : Identifiers and Keywords Keyword - Iskeyword Def Class
Isdigit : Identifiers and Keywords Keyword - Iskeyword Def Class
4 documentation
Return True if all characters in the string are decimal characters and there is at least one
character, False otherwise. Decimal characters are those that can be used to form numbers in
base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a decimal character is a
character in the Unicode General Category “Nd”.
str. isdigit()
Return True if all characters in the string are digits and there is at least one character, False
otherwise. Digits include decimal characters and digits that need special handling, such as the
compatibility superscript digits. This covers digits which cannot be used to form numbers in
base 10, like the Kharosthi numbers. Formally, a digit is a character that has the property value
Numeric_Type=Digit or Numeric_Type=Decimal.
str. isidentifier()
Return True if the string is a valid identifier according to the language definition, section
Identifiers and keywords.
Call keyword.iskeyword() to test whether string s is a reserved identifier, such as def and
class .
Example:
str. islower()
Return True if all cased characters [4] in the string are lowercase and there is at least one
cased character, False otherwise.
str. isnumeric()
Return True if all characters in the string are numeric characters, and there is at least one
character, False otherwise. Numeric characters include digit characters, and all characters that
have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH.
Formally, numeric characters are those with the property value Numeric_Type=Digit,
Numeric_Type=Decimal or Numeric_Type=Numeric.
str. isprintable()
Return True if all characters in the string are printable or the string is empty, False otherwise.
Nonprintable characters are those characters defined in the Unicode character database as
“Other” or “Separator”, excepting the ASCII space (0x20) which is considered printable. (Note
that printable characters in this context are those which should not be escaped when repr() is
https://docs.python.org/3/library/stdtypes.html#old-string-formatting 24/74
7/14/2020 Built-in Types — Python 3.8.4 documentation
str. isspace()
Return True if there are only whitespace characters in the string and there is at least one
character, False otherwise.
A character is whitespace if in the Unicode character database (see unicodedata ), either its
general category is Zs (“Separator, space”), or its bidirectional class is one of WS , B , or S .
str. istitle()
Return True if the string is a titlecased string and there is at least one character, for example
uppercase characters may only follow uncased characters and lowercase characters only cased
ones. Return False otherwise.
str. isupper()
Return True if all cased characters [4] in the string are uppercase and there is at least one
cased character, False otherwise.
str. join(iterable)
Return a string which is the concatenation of the strings in iterable. A TypeError will be raised if
there are any non-string values in iterable, including bytes objects. The separator between
elements is the string providing this method.
str. lower()
Return a copy of the string with all the cased characters [4] converted to lowercase.
The lowercasing algorithm used is described in section 3.13 of the Unicode Standard.
str. lstrip([chars])
Return a copy of the string with leading characters removed. The chars argument is a string
specifying the set of characters to be removed. If omitted or None , the chars argument defaults
to removing whitespace. The chars argument is not a prefix; rather, all combinations of its values
are stripped:
https://docs.python.org/3/library/stdtypes.html#old-string-formatting 25/74