Python unichr() Function

Python 内置函数Python Built-in Functions


Description

The unichr() function is basically the same as the chr() function, except that it returns a Unicode character.

Note: Python3 does not support unichr(); use thechr()function.

Syntax

The following is the syntax of the unichr() method:

unichr(i)

Parameters

  • i -- Can be a number in decimal or hexadecimal form.

Return Value

Returns a Unicode character.


Example

The following shows an example of using the unichr() method:

>>>unichr(97) u'a' >>> unichr(98) u'b' >>> unichr(99) u'c'

Python 内置函数Python Built-in Functions

Other Extensions