{"id":24544,"date":"2021-10-21T10:06:24","date_gmt":"2021-10-21T04:36:24","guid":{"rendered":"https:\/\/python-programs.com\/?p=24544"},"modified":"2021-11-05T19:38:17","modified_gmt":"2021-11-05T14:08:17","slug":"python-chr-function-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-chr-function-with-examples\/","title":{"rendered":"Python chr() function with Examples"},"content":{"rendered":"

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

The character that represents the specified unicode is returned by the chr() function.<\/p>\n

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

chr(number)<\/pre>\n

Parameters<\/strong><\/p>\n

number:<\/strong> It is an integer. A valid Unicode code point is represented by an integer.<\/p>\n

The integer has a valid range of 0 to 1,114,111.<\/p>\n

Return value:<\/strong><\/p>\n

Returns a character (string) with the integer as its Unicode code point.<\/p>\n

If the integer falls outside of the range, a ValueError will be thrown.<\/p>\n

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

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

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

Given first number = 68\r\nGiven second number = 101<\/pre>\n

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

The character that represents the given unicode 68 = D\r\nThe character that represents the given unicode 101 = e<\/pre>\n

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

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

Given first number = 99\r\nGiven second number = 75<\/pre>\n

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

The character that represents the given unicode 99 = c\r\nThe character that represents the given unicode 75 = K<\/pre>\n

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