Python Cookbook学习记录 ch1_2_2013/10/21
摘要:
1.2 字符和字符值之间的转换a.ASCII码之间的转换ord获得字符对应的ASCII码,chr根据ASCII码获得字符>>> print chr(100)d>>> print ord('d')100unichr可以将Unicode码转成Unicode字符>>> print ord(u'H')72>>> print unichr(72)H讨论:chr和str的区别:chr是将整数转成ASCII码对应的字符,str是将所有输入转成文本形式的字符串>>> print chr(1 阅读全文
posted @ 2013-10-21 22:27 七海之风 阅读(167) 评论(0) 推荐(0)
浙公网安备 33010602011771号