The method isdigit() checks whether the string consists of digits only.
NA
str.isdigit()
#!/usr/bin/python str = "123456"; # Only digit in this string print str.isdigit() str = "this is string example....wow!!!"; print str.isdigit()
When we run above program, it produces following result −
True False