Function Details: isdigit

Description


Return True if all characters in the string are digits and there is at least one character, False otherwise.


Extended Description


The isdigit() method checks if all the characters in the string are digits. This includes decimal digits and digits from other number systems. It's less restrictive than isdecimal() but more restrictive than isnumeric(). It considers characters to be digits if they have the Unicode property value Numeric_Type=Digit or Numeric_Type=Decimal.


Read More about isdigit from Python Documentation

Function Signature



Module: builtins

Class: str

Parameters



Return


Returns a boolean indicating whether all characters in the string are digits.


Return Type


bool

Output

Explanation

This example demonstrates the basic usage of isdigit(). It returns True because all characters are digits.