PyDocs

Nav

Python Runtime Services

str.isnumeric

builtins

method of str
  • str.isnumeric()
Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and
there is at least one character in the string.
1 Example
>>> '0123456789'.isnumeric()
True
>>> '٠١٢٣٤٥٦٧٨٩'.isnumeric()  # Arabic-Indic digits zero to nine
True
>>> '⅕'.isnumeric()  # Vulgar fraction one fifth
True
>>> '²'.isdecimal(), '²'.isdigit(),  '²'.isnumeric()
(False, True, True)
from the Python docs
See Also
No see-alsos for builtins/str.isnumeric
0 Notes
No notes for str.isnumeric