您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

python函数之chr(i)

2024/3/21 5:17:27发布30次查看
chr(i)中文说明:
返回整数i对应的ascii字符。与ord()作用相反。
参数x:取值范围[0, 255]之间的正数。
版本:该函数在python2和python3各个版本中都可用。不存在兼容性问题。
英文说明:
return a string of one character whose ascii code is the integer i. for example, chr(97) returns the string 'a'. this is the inverse of ord(). the argument must be in the range [0..255], inclusive; valueerror will be raised if i is outside that range. see also unichr().
代码实例:
>>> chr(97) 'a' >>> chr(98) 'b' >>> ord('a') 97 >>> ord('b') 98
ps:呵呵,这个函数和php里面的用法是一样的哦
以上就是python函数之chr(i)的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product