{"id":24468,"date":"2021-10-17T18:43:40","date_gmt":"2021-10-17T13:13:40","guid":{"rendered":"https:\/\/python-programs.com\/?p=24468"},"modified":"2021-11-05T19:24:56","modified_gmt":"2021-11-05T13:54:56","slug":"program-for-python-string-isdecimal-method","status":"publish","type":"post","link":"https:\/\/python-programs.com\/program-for-python-string-isdecimal-method\/","title":{"rendered":"Program for Python String isdecimal() Method"},"content":{"rendered":"

In the previous article, we have discussed Python Program for gamma() Function<\/a>
\nisdecimal() Function in Python:<\/strong><\/p>\n

If all of the characters are decimals(0-9), the isdecimal() method returns True.<\/p>\n

On unicode objects, this method is used.<\/p>\n

Syntax:<\/strong><\/p>\n

string.isdecimal()<\/pre>\n

Parameters:\u00a0<\/strong>This function has no parameters.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first string = \"123456789_python\"\r\nGiven second string = \"92567\"<\/pre>\n

Output:<\/strong><\/p>\n

The above given first string is : 123456789_python\r\nThe given first string after applying isdecimal() function: False\r\nThe above given second string is : 92567\r\nThe given second string after applying isdecimal() function: True<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first string = \"\\u0039\"  (#unicode for 9)\r\nGiven second string = \"92567\"<\/pre>\n

Output:<\/strong><\/p>\n

The above given first string is : 9\r\nThe given first string after applying isdecimal() function: True\r\nThe above given second string is : 92567\r\nThe given second string after applying isdecimal() function: True<\/pre>\n

Program for isdecimal() Function\u00a0in Python<\/h2>\n