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

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

The isalnum() method returns a value True if all of the characters are alphanumeric, which means they are alphabet letters (a-z) and numbers (0-9).<\/p>\n

(space)!#%&? etc are examples of characters that are not alphanumeric.<\/p>\n

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

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

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

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

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

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

Given first string = \"pythonprograms\"\r\nGiven second string = \"10345 @@@good morning\"<\/pre>\n

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

The above given first string is : pythonprograms\r\nThe given first string after applying isalnum() function: True\r\nThe above given second string is : 10345 @@@good morning\r\nThe given second string after applying isalnum() function: False<\/pre>\n

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

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

Given first string = \"hello this is python programming platform\"\r\nGiven second string = \"hello123\"<\/pre>\n

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

The above given first string is : hello this is python programming platform\r\nThe given first string after applying isalnum() function: False\r\nThe above given second string is : hello123\r\nThe given second string after applying isalnum() function: True<\/pre>\n

Program for isalnum() Function in Python<\/h2>\n