{"id":3660,"date":"2022-12-02T17:49:54","date_gmt":"2022-12-02T17:49:54","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=3660"},"modified":"2022-12-02T17:49:56","modified_gmt":"2022-12-02T17:49:56","slug":"python-string-isalnum","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/python-string-isalnum\/","title":{"rendered":"Python String isalnum() Method With Example"},"content":{"rendered":"<p style=\"text-align: center;\">Python String isalnum<\/p>\n<p>Now, we are going to learn about the isalnum method. As the name of the method suggests, with this method, we can check if all the characters in the string are alphanumeric. The method returns True if all the characters in the string are alphanumeric, and False otherwise. Let\u2019s have a look at a simple program, which tries to demonstrate the use of the isalnum method.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3661 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isalnum-METHOD.jpg\" alt=\"\" width=\"630\" height=\"65\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isalnum-METHOD.jpg 630w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isalnum-METHOD-300x31.jpg 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/p>\n<h2 style=\"text-align: center;\">Python String isalnum() Method<\/h2>\n<p>As you can see in the above program, we have a string, in which, there are alphabets and numbers. Then, we are calling the isalnum method. In this case, the method is going to return True, since all the characters in the given string are alphanumeric. You can try executing the program and observing the output.<\/p>\n<p>Now, Let\u2019s have a look at another example, in which, we would have some symbols as well, Let\u2019s have a look at the program.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3662 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isalnum-METHOD-1.jpg\" alt=\"\" width=\"628\" height=\"71\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isalnum-METHOD-1.jpg 628w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isalnum-METHOD-1-300x34.jpg 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/p>\n<p>As you can see in the above program, we have a string, in which, we have some alphanumeric characters, but there is also a symbol. So, the return value from the isalnum method is going to be False this time. You can try executing the program and checking the output.<\/p>\n<p>So, as and when required, we can make use of the isalnum method, which can be used to check if all the characters in the string are alphanumeric. It returns True if all the characters in the string are alphanumeric, and False otherwise.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python String isalnum Now, we are going to learn about the isalnum method. As the name of the method suggests, with this method, we can check if all the characters in the string are alphanumeric. The method returns True if all the characters in the string are alphanumeric, and False otherwise. Let\u2019s have a look [&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-3660","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\/3660","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=3660"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3660\/revisions"}],"predecessor-version":[{"id":4185,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3660\/revisions\/4185"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=3660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=3660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=3660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}