Chinaunix首页 | 论坛 | 博客
  • 博客访问: 389906
  • 博文数量: 199
  • 博客积分: 154
  • 博客等级: 入伍新兵
  • 技术积分: 1530
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-14 08:43
文章分类

全部博文(199)

文章存档

2015年(101)

2014年(97)

2011年(1)

分类: Python/Ruby

2015-05-26 19:20:26

中文说明:
返回整数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
阅读(951) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~