Reading about Python? Actually practice it. Try PyChallenge free

Python Tutorial

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
BackNext

Practice
Stop reading. Start writing Python.
PyChallenge gives you interactive exercises in your browser — no install needed.
Practice Python with interactive exercises