String isdigit

Return True if string consits only of digits.

Syntax

The format is:

str.isdigit()

Parameters

None

Example

str = u"string digit 1234"
print( str.isdigit() )
 
str = u"12345"
print( str.isdigit() )

Result:


False
True