Function Details: isdecimal

Description


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


Extended Description


The isdecimal() method checks if all the characters in the string are decimal characters. Decimal characters are those that can be used to form numbers in base 10. This method is more restrictive than isdigit() and isnumeric(). It only considers characters that are decimal digits, which are the numbers 0-9.


Read More about isdecimal from Python Documentation

Function Signature



Module: builtins

Class: str

Parameters



Return


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


Return Type


bool

Output

Explanation

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