What is isnumeric() in Python?

The isnumeric method in Python is used to check if every character in a string is a number.

Syntax

`string.isnumeric()` 

Return value

It returns True if every character in the string is a number, otherwise it will return False.

Example

print("11".isnumeric()) # numbers
print("hello".isnumeric()) # letters
print("hello11".isnumeric()) # combination of alphanumeric characters

Free Resources