我正在尝试根据两个单独的列表提取项目列表之间的文本。For example start = ['intro','Intro','[intro','Introduction',(intro)]end = ['P1','P2','[P1','[P2']input:introL1L2P1L3L4[intro]L5L6Expected Output:L1L2L5L6我怎么能做到这一点,试过了text = 'I want to find a string between two substrings'start = 'find a 'end = 'between two'print(text[text.index(start)+len(start):text.index(end)])我想要基于示例 1 的输出
添加回答
举报
0/150
提交
取消