Python判断⼀个list中是否包含另⼀个list全部元素的⽅法 分析 本⽂实例讲述了Python判断⼀个list中是否包含另⼀个list全部元素的⽅法。分享给⼤家供⼤家参考,具体如下:你可以⽤for in循环+in来判断 #!/usr/bin/env python # coding: utf-8 a = [1, 2, 3, 4, 5]b = [3, 4, 5]...
1], sublist = [8, 2, 3] Output : False Input : test_list = [5, 6, 3, 8, 2, 3...
判断列表是否包含另一列表 list1 = ["one","two","three"] list2 = ["one","three","two","four"] set(list1).issubset(set(list2)) set(list2).issuperset(set(list1)) 1. 2. 3. 4.