# How to check if a unicode string contains only numeric characters in Python?

PythonServer Side ProgrammingProgramming

#### Beyond Basic Programming - Intermediate Python

Most Popular

36 Lectures 3 hours

#### Practical Machine Learning using Python

Best Seller

91 Lectures 23.5 hours

#### Practical Data Science using Python

22 Lectures 6 hours

If we want to check if a unicode string contains only numeric characters, we can use the special method isnumeric() that exists solely for checking unicode strings. You can use it as follows −

## Example

print(u"1234".isnumeric())
print(u"1,a234".isnumeric())

## Output

True
False
Updated on 13-Feb-2020 09:17:24