Python学习记录
清风若雪
这个作者很懒,什么都没留下…
展开
-
Python学习Iterable和Iterator
Iterable可以直接作用于for循环的对象称为的迭代器对象:Iterable 在Python中的集合数据类型(list、tuple、dict、set、str等)和generator,包括生成器和带yield的generator function等都属于Iterable #验证 #isinstance()为Python内置可判断类型的函数,和java的instanceof差不多 >>> from原创 2017-03-15 17:45:24 · 536 阅读 · 0 评论 -
杨辉三角的Python实现
杨辉三角如下: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1在网上看到的一个实现,由此记录下来,可将杨辉三角看成如下形式1, 0, 1, 1, 0, 1, 2原创 2017-03-15 18:16:23 · 427 阅读 · 0 评论