我有以下意见:
my_list = [
0, 'root', 'disable', 'dynamic', 'pages', 'login', 'sensitive', 'registration', 'screen', 'flag_secure', 'application', 'frida', 'blurring', 'instrumentation', 'mechanism', 'recent', 'debugger', 'information', 'restrict', 'stronger', 'anti', 'capture', 'appsview', 'strengthen', 'code', 'data', 'exported', 'use', 'protection', 'default', 'ensure', 'hide', 'improve', 'runtime', 'copy', 'paste', 'expired', 'impelement', 'frequency', 'adding', 'feature', 'instrument', 'attempts', 'avoid', 'escape', 'authentication', 'encryption', 'components', 'device', 'char', 'verification',
1, 'detection', 'frequency', 'dynamic', 'emulator', 'encoding', 'encrypt', 'encryption', 'ensure', 'escape', 'expired', 'exported', 'feature', 'flag_secure', 'frame', 'frida', 'device', 'generated', 'hardcoding', 'headers', 'hide', 'impelement', 'implement', 'improve', 'information', 'input', 'instrument', 'instrumentation', 'integrity', 'disable', 'version', 'verification', 'char', 'access', 'adding', 'alert', 'anti', 'application', 'appsview', 'array', 'attempts', 'authentication', 'avoid', 'blurring', 'capture', 'character', 'default', 'check', 'code', 'come', 'components',
2, 'implement', 'version', 'frequency', 'dynamic', 'emulator', 'encoding', 'encrypt', 'encryption', 'ensure', 'escape', 'expired', 'exported', 'feature', 'flag_secure', 'frame', 'frida', 'device', 'generated', 'hardcoding', 'headers', 'hide', 'impelement', 'improve', 'information', 'input', 'instrument', 'instrumentation', 'integrity', 'disable', 'detection', 'verification', 'char', 'access', 'adding', 'alert', 'anti', 'application', 'appsview', 'array', 'attempts', 'authentication', 'avoid', 'blurring', 'capture', 'character', 'default', 'check', 'code', 'come', 'components',
3, 'access', 'version', 'frequency', 'dynamic', 'emulator', 'encoding', 'encrypt', 'encryption', 'ensure', 'escape', 'expired', 'exported', 'feature', 'flag_secure', 'frame', 'frida', 'device', 'generated', 'hardcoding', 'headers', 'hide', 'impelement', 'implement', 'improve', 'information', 'input', 'instrument', 'instrumentation', 'integrity', 'disable', 'detection', 'verification', 'default', 'adding', 'alert', 'anti', 'application', 'appsview', 'array', 'attempts', 'authentication', 'avoid', 'blurring', 'capture', 'char', 'character', 'check', 'code', 'come', 'components'
]
从这个列表中,如何为列表中的每个整数创建两个新列表,并在每个新列表中追加string元素
例如,新列表应包含第一个整数(即0或1或2或3),以及列表中下一个整数之前的十几个字符串元素
这就是我希望得到的结果:
List0 = [0, 'root', 'disable', 'dynamic', 'pages', 'login', 'sensitive', 'registration', 'screen', 'flag_secure', 'application', 'frida', 'blurring', 'instrumentation', 'mechanism', 'recent', 'debugger', 'information', 'restrict', 'stronger', 'anti', 'capture', 'appsview', 'strengthen', 'code', 'data', 'exported', 'use', 'protection', 'default', 'ensure', 'hide', 'improve', 'runtime', 'copy', 'paste', 'expired', 'impelement', 'frequency', 'adding', 'feature', 'instrument', 'attempts', 'avoid', 'escape', 'authentication', 'encryption', 'components', 'device', 'char', 'verification']`
List1 = [1, 'detection', 'frequency', 'dynamic', 'emulator', 'encoding', 'encrypt', 'encryption', 'ensure', 'escape', 'expired', 'exported', 'feature', 'flag_secure', 'frame', 'frida', 'device', 'generated', 'hardcoding', 'headers', 'hide', 'impelement', 'implement', 'improve', 'information', 'input', 'instrument', 'instrumentation', 'integrity', 'disable', 'version', 'verification', 'char', 'access', 'adding', 'alert', 'anti', 'application', 'appsview', 'array', 'attempts', 'authentication', 'avoid', 'blurring', 'capture', 'character', 'default', 'check', 'code', 'come', 'components']`
# ...etc
我怎样才能做到这一点
您可以找到列表中出现整数的索引。在列表之外添加“索引”,即列表的长度。这些代表了从你需要的块中取出的切入点
使用
zip
可以组合这些块的开始/结束范围,并使用这些范围相应地对列表进行切片:结果将是一个列表列表。您可以按如下方式打印每个列表:
如果您希望一个列表中包含十几个列表:
见result
相关问题 更多 >
编程相关推荐