![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python个人学习笔记
睡到中午自然醒
这个作者很懒,什么都没留下…
展开
-
MacOS安装python3
Mac系统自带python,不过版本是2.x的,我的系统python版本是2.7.10。skdeMacBook-Air:~ Kevin$ pythonPython 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwinType原创 2018-01-24 11:12:31 · 244 阅读 · 0 评论 -
python中连续赋值遇到的问题
在学习生成器的时候做了一个生成斐波那契数列的练习,下面是练习的代码:import sysdef fib(n): a, b, count = 0, 1, 0 while 1: if count >= n: return yield a a, b, count = b, a + b, count+1原创 2018-01-24 18:33:31 · 636 阅读 · 0 评论 -
python中与或运算
逻辑与(and):>>> 1 and "a"'a'>>> 0 and "a"0 逻辑或(or): >>> 0 or "a"'a' 与或运算: 观察下面两个运算可以看出0和1可以作为输出'a'或'b'的开关。>>> 0 and 'a原创 2018-08-12 23:37:30 · 24474 阅读 · 0 评论 -
获得对象可被调用的方法及方法文档
def info(object, collapse=1, spacing=15): """ 使用更加格式化的方式来将 object中可以被调用的方法,被调用的方法详细的文档说明打印出来 collapse默认为1,用于选择分割字符串的方式,使processFun得值为" ".join(s.split()), 如果设为0,则为s """ me...原创 2018-08-13 00:20:41 · 193 阅读 · 0 评论