Skip to content
String Methods

isnumeric()

Check whether every character has a numeric value.

str.isnumeric()

Check whether every character has a numeric value.

Returns

True when the string is non-empty and all characters are numeric; otherwise False.

Try it

Run it and change it
text = "½"
print(text.isnumeric())

Worth knowing

  • isnumeric() is the broadest of the three common number checks. It accepts characters such as fractions that isdigit() and isdecimal() may reject.

Related entries