Summary of knowledge points of python unichr function

  • 2021-08-21 21:03:13
  • OfStack

At that time of binary study, Careful friends inevitably find the existence of unicher function, That's right, what can be seen frequently, that is, about the conversion of the binary system, there must be some small partners to be happy, because the binary system 1 is a headache in writing. If there is a special service function, 1 can definitely solve the headache problem in the binary system conversion. This site is to solve the problem for everyone, and the answer is below.

1. Description:

Returns the character of unicode.

2. Grammar:


unichr()

3. Parameters:

Returns a number that is in binary

4. Type:

unichr (x) converts a 1 integer to an Unicode character

5. Example demonstration:


>>> unichr(109)
u'a'
>>> unichr(98)
u'b'

Content extension:

Python unichr () Function

Describe

The unichr () function and the chr () function are basically identical, except that they return unicode characters.

Note: unichr () is not supported by Python3, so the chr () function is used instead.

Grammar

Here is the syntax for the unichr () method:


unichr(i)

Parameter

i-A number that can be either decimal or hexadecimal.

Return value

Returns the character of unicode.

Instances

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


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

Related articles: