Python String isdecimal() Method
Example
Check if all characters in unicode object are decimal numbers:
txt = "\u0033" #unicode for 3 x = txt.isdecimal() print(x)
Definition and Usage
If all characters are decimal numbers (0-9), the isdecimal() method will return True.
This method is used for unicode objects.
Syntax
string.isdecimal()
Parameter value
No parameters.
More Examples
Example
Check if all characters in unicode are decimal numbers:
a = "\u0030" #unicode for 0 b = "\u0047" #unicode for G print(a.isdecimal()) print(b.isdecimal())