首页 > 编程语言 > 详细

python内置函数2-chr()

时间:2017-02-17 00:57:52      阅读:198      评论:0      收藏:0      [点我收藏+]

Help on built-in function chr in module __builtin__:


chr(...)

    chr(i) -> character

    

    Return a string of one character with ordinal i; 0 <= i < 256.

chr(i)

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().


中文说明:

返回整数i对应的ASCII字符。与ord()作用相反。

参数x:取值范围[0, 255]之间的正数。


>>> chr(46)

‘.‘

>>> chr(57)

‘9‘

>>> chr(89)

‘Y‘


本文出自 “大云技术” 博客,请务必保留此出处http://hdlptz.blog.51cto.com/12553181/1898431

python内置函数2-chr()

原文:http://hdlptz.blog.51cto.com/12553181/1898431

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!