String isdecimal
Return True if string is decimal.
Syntax
The format is:str.isdecimal()
Parameters
None
Example
str = u"1.234"
print( str.isdecimal() )
str = u"12345"
print( str.isdecimal() )
Result:
False True
Practice
Stop reading. Start writing Python.
PyChallenge gives you interactive exercises in your browser — no install needed.
Practice Python with interactive exercises