Return True if the string is a digit string, False otherwise. A string is a digit string if all characters in the string are digits and there is at least one character in the string.
>>> '0123456789'.isdigit() True >>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # Arabic-Indic digits zero to nine True >>> '⅕'.isdigit() # Vulgar fraction one fifth False >>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric() (False, True, True)
builtins/str.isdigit
str.isdigit