/  Isdecimal() method in Python String Module

Isdecimal() method in Python String Module

Isdecimal method in string module returns the outputas TRUE if the string has only decimal characters. Also characters or alphabets in the string return the outputas FALSE.


Syntax:

str.isdecimal()


Example-1:

text = "4587" 
x = text.isdecimal()
print(x)


Output:


Example-2:

text = "219.8" 
x = text.isdecimal()
print(x)


Output: