摘要: python列表推导式 特点:语言简单,速度快等优点!!! 1,取出名字长度大于3的人 >>> names=['java','scala','python','hadoop','c','c++']>>> names['java', 'scala', 'python', 'hadoop', 'c', 阅读全文
posted @ 2018-05-02 15:27 cindy_zl 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 判断一个对象是迭代对象: 方法是用collections 模块的Iterable类型判断 >>> from collectoins import Iterable >>>isinstance('abc',Iterable) #str是否可迭代 >>>isinstance([1,2,3],Iterab 阅读全文
posted @ 2018-05-02 12:15 cindy_zl 阅读(130) 评论(0) 推荐(0) 编辑