Returns a Boolean stating whether the string contains only digits.
str. isdigit()
bool
#TODO
For 8-bit strings, this method is locale-dependent. Returns False if string is empty.
>>> ''.isdigit()
False
>>> 'abc123'.isdigit()
False
>>> 'abc'.isdigit()
False
>>> '123'.isdigit()
True
>>> 'Abc'.isdigit()
False
>>> '!@#'.isdigit()
False
>>> ' '.isdigit()
False
>>> 'ABC'.isdigit()
Falseisalnum(), isalpha(), isdigit(), islower(), isspace(), istitle(), isupper()