【python】对于ord函数的误区

ord、hex、bin
都是我们常用的python函数

很多人喜欢把ord当作字符取ASCII码的函数
在这里插入图片描述

实际上官方已经给出了ord是字符取Unicode码的函数
在这里插入图片描述

附录

python原生函数的性能比较

在这里插入图片描述

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/AiTanXiing/article/details/131292369