<jupyter_start><jupyter_text>All the IPython Notebooks in this lecture series by Dr. <NAME> are available @ **[GitHub](https://github.com/milaan9/02_Python_Datatypes/tree/main/002_Python_String_Methods)**  Python String `isdecimal()`The string **`isdecimal()`** method returns **`True`** if all characters in the string are decimal characters. If not, it returns **`False`**.**Syntax**:```pythonstring.isdecimal()```  `isdecimal()` ParametersThe **`isdecimal()`** method doesn't take any parameters.  Return Value from `isdecimal()`The **`isdecimal()`** returns:* **`True`** if all characters in the string are decimal characters.* **`False`** if at least one character is not decimal characters.<jupyter_code># Example 1: Working of isdecimal()

s = "28212"
print(s.isdecimal())

# contains alphabets
s = "32ladk3"
print(s.isdecimal())

# contains alphabets and spaces
s = "Mo3 nicaG el l22er"
print(s.isdecimal())<jupyter_output>True
False
False<jupyter_text>**Explanation:**The superscript and subscripts are considered digit characters but not decimals. If the string contains these characters (usually written using unicode), **`isdecimal()`** returns **`False`**.Similarly, roman numerals, currency numerators and fractions are considered numeric numbers (usually written using unicode) but not decimals. The **`isdecimal()`** also returns **`False`** in this case.There are two methods **`isdigit()`** and **`isnumeric()`** that checks whether the string contains digit characters and numeric characters respectively.Learn more about **[isdigit()](https://github.com/milaan9/02_Python_Datatypes/blob/main/002_Python_String_Methods/014_Python_String_isdigit%28%29.ipynb)** and **[isnumeric()](https://github.com/milaan9/02_Python_Datatypes/blob/main/002_Python_String_Methods/017_Python_String_isnumeric%28%29.ipynb)** methods.<jupyter_code># Example 2: String Containing digits and Numeric Characters

s = '23455'
print(s.isdecimal())

#s = '²3455'
s = '\u00B23455'
print(s.isdecimal())

# s = '½'
s = '\u00BD'
print(s.isdecimal())<jupyter_output>True
False
False
{'fraction_non_alphanumeric': 0.14154589371980678, 'fraction_numerical': 0.030434782608695653, 'mean_word_length': 6.9653846153846155, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '169018', 'license': 'MIT', 'n_tokens_mistral': 724, 'n_tokens_neox': 651, 'n_words': 190, 'path': '002_Python_String_Methods/013_Python_String_isdecimal().ipynb', 'repo_name': 'Maxc390/python-discrete-structures', 'size': '2076'}