摘要:
http://stackoverflow.com/questions/2776829/difference-between-python-generators-vs-iteratorsiteratoris a more general concept: any object whose class has anextmethod (__next__in Python 3) and an__iter__method that doesreturn self.Every generator is an iterator, but not vice versa. A generator is bui 阅读全文
摘要:
__author__ = 'daitr'#--coding:utf-8--import datetime#方法一:#a=[2,3,4,5]#b=[2,5,8]#tmp = [val for val in a if val in b]#print tmp##[2, 5]#方法二#print list(set(a).intersection(set(b)))#print list(set(a).union(set(b)))#print list(set(b).difference(set(a))) # b中有而a中没有的a,b= [],[]for i in range(1,6000 阅读全文