Difference between isdigit and isnumeric

@dsedyoda
What’s the difference between the isdigit() function and isnumeric() function ??

1 Like

isdigit() checks if the string is composed of the popular numerical values from 0-9. but isnumeric() also checks if the string is composed of numerical values in different languages as well. you can say isdigit() is a subset of isnumeric()

2 Likes

Can you differentiate with an example where isdigit() is different with isnumeric(). Which will give me more clarity about this ??

1 Like

Hi,
I was kind of wrong above. sorry about that. it seems like it isdigit also supports some of the digits in other lanugages, but not all, while isnumeric supports all. one thing isdigit does not support are roman numerals. you can see that in the picture below.

image

here’s a link that you can read to know more regarding which numerals are supported by isdigit and isnumeric.