2017-09-22 python python two or three continuous items in list Python list 中连续2-3个对象1.前后连续两天12for date in [eval_obj.date_range[i:i+2] for i in range(len(eval_obj.date_range) - 1)]: print date[0], date[1] 2.时间间隔1-3天123for t in [time_list[i:i + 3] for i in range(len(time_list) - 1)]: if len(t) == 3: print(t[0], t[2]) Newer acquire array length in cpp Older Hello World