Can't use unichr in Python 3.1

后端 未结 5 1044
别那么骄傲
别那么骄傲 2021-02-03 16:33

I\'ve been looking through the Python Cookbook (2nd Edition) to learn how to process strings and characters.

I wanted to try converting a number into its

5条回答
  •  长情又很酷
    2021-02-03 17:34

    In Python 3, there's no difference between unicode and normal strings anymore. Only between unicode strings and binary data. So the developers finally removed the unichr function in favor of a common chr which now does what the old unichr did. See the documentation here.

提交回复
热议问题