{"id":3664,"date":"2022-12-02T18:10:47","date_gmt":"2022-12-02T18:10:47","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=3664"},"modified":"2022-12-02T18:10:48","modified_gmt":"2022-12-02T18:10:48","slug":"python-string-isdecimal","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/python-string-isdecimal\/","title":{"rendered":"Python String isdecimal() Method With Example"},"content":{"rendered":"<p style=\"text-align: center;\">Python String isdecimal() Method With Example<\/p>\n<p>Now, we are going to learn about the isdecimal method. As the name of the method suggests, with the isdecimal method, we can check if all the characters in the string are decimals. The method returns True if all the characters in the string are decimal characters, and otherwise, the method returns False. Let\u2019s have a look at a simple program, which demonstrates the same thing.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3665 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isdecimal-METHOD.jpg\" alt=\"\" width=\"623\" height=\"80\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isdecimal-METHOD.jpg 623w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isdecimal-METHOD-300x39.jpg 300w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/p>\n<h2 style=\"text-align: center;\">Python String isdecimal() Method<\/h2>\n<p>As you can see in the program, we have the string, where all the characters are decimal characters. Then we are calling the isdecimal method. This method returns True in this case. Let\u2019s have a look at another case when all the characters in the string are not decimal characters.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3666 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isdecimal-METHOD-1.jpg\" alt=\"\" width=\"642\" height=\"75\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isdecimal-METHOD-1.jpg 642w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isdecimal-METHOD-1-300x35.jpg 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/p>\n<p>As you can see in the program, we have a string, in which, all the characters are not decimal characters. In such a situation, the isdecimal method returns False.<\/p>\n<p>So, as and when required, we can make use of the isdecimal method, to check if all the characters in the string are decimal characters. It returns True, if all the characters in the string are decimal characters, and False otherwise.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python String isdecimal() Method With Example Now, we are going to learn about the isdecimal method. As the name of the method suggests, with the isdecimal method, we can check if all the characters in the string are decimals. The method returns True if all the characters in the string are decimal characters, and otherwise, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[26,27],"class_list":{"0":"post-3664","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-python-tutorial","7":"tag-python","8":"tag-python-tutorial"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=3664"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3664\/revisions"}],"predecessor-version":[{"id":4186,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3664\/revisions\/4186"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=3664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=3664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=3664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}