python list comprehension - use of any

前端 未结 0 1193
闹比i
闹比i 2021-01-17 09:00
test_list = [(1, 4, 6), (5, 8), (2, 9), (1, 10)] 
 
tar_list = [6, 10] 

From test list keep tuples that contain any of the target list elements:

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