码迷,mamicode.com
首页 > 编程语言 > 详细

Python笔记

时间:2017-10-04 16:17:19      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:red   ==   repr   序号   python笔记   尾递归   nbsp   字符   文件   

Python中一些微小但很有用的知识点


 

>>> ord(‘A‘)   # 获取字符的序号
65

>>> chr(666)  # 通过序号获取字符
‘?‘

 >>> hex(16)  # 十六进制

‘0x10‘

>>> oct(66)  # 八进制
‘0o102‘

repr/eval

filter / map / zip / reduce 

 

enumerate

 

print >> f, "hehe"   # 将字符打印到文件中

汉字unicode集:\u4E00 ~ \u9FFF(\u9FA5)
尾递归

====================== 完 =======================

 

Python笔记

标签:red   ==   repr   序号   python笔记   尾递归   nbsp   字符   文件   

原文地址:http://www.cnblogs.com/mygodfalling/p/7625718.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!