Python split list before and after specific value

后端 未结 0 593
生来不讨喜
生来不讨喜 2020-12-07 23:26

I want to split a list into tuples after and before a specific value.

Example

Input:

list1 = [2, 1, 1, 2, 1, 2, 1, 1]
print(some_func(list1, 2))         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题