Python:Ascii character<->decimal representation conversion

后端 未结 4 511
情歌与酒
情歌与酒 2021-02-04 04:13

Hi I need to be able to convert a ascii character into its decimal equivalent and vice-versa.

How can I do that?

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 04:48

    Use ord to convert a character into an integer, and chr for vice-versa.

提交回复
热议问题