String isdigit( ) Method
The method isdigit() checks whether the string
consists of digits only.
Syntax
str.isdigit()
|
Return Value
This method returns true if all characters in the
string are digits and there is at least one
character, false otherwise.
Example
#!/usr/bin/python3
str
= "123456"; # Only digit
in this string
print
(str.isdigit())
str
= "this is string example....wow!!!"
print
(str.isdigit())
|
Result
True
False
|
<<< isalpha( ) Go to Index islower( ) >>>