我有一个list如下结构:L=["ticket1","ticket2","spec1","spec2","ticket3","ticket4","spec3","ticket5","spec4","spec5","ticket6","ticket7","ticket8","ticket9","ticket10","spec6","spec7","ticket11","ticket12","ticket13","spec8","ticket14","spec9","ticket15","ticket16","ticket17","ticket18","spec1""ticket19","ticket20","spec2""ticket21"]想要挑出来后面没有跟着spec的ticket,具体规则如下:1.如果连续两个ticket后面跟着连续两个spec,那么这两个ticket算有spec,如ticket1,ticket2;ticket9,ticket102.如果一个ticket后面跟着一个或者连续多个spec,那么这个ticket也算有spec,如ticket4,ticket5,ticket13,ticket14;剩下的ticket都算是没有spec的,我想要挑出这些ticket,有哪些好的方法可以使用呀?没有spec的ticket如下:ticket3,ticket6,ticket7,ticket8,ticket11,ticket12,ticket15,ticket16,ticket17,ticket19,ticket21列表里面的信息是唯一的信息,请教各位大神有什么方法可以实现这样的挑选。
慕的地10843
喵喵时光机
相关分类