Python String isdigit() MethodPython Functions
The isdigit() method checks if a string consists of only numbers. It means that a string will be judged to be not digital if any part is not a number.
# -*- coding: UTF-8 -*-
str1 = '123456789'
str2 = '1234567.89'
str3 = "12346+789"
Here ‘1234567.89’ is still judged as not digital because the dot ‘.’ is not number.
The method doesn’t take any parameters.
It returns boolean value (True or False).