Answers for "check if set is a subset of another python"

1

python subset

# Creating sets
A = {1, 2, 3}
B = {1, 2, 3, 4, 5}

# Checking if A is subset of B (vice versa)
# Returns True
# A is subset of B
print(A.issubset(B))

# Returns False
# B is not subset of A
print(B.issubset(A))
Posted by: Guest on August-05-2020
0

how to check if a list is a subset of another list

if(all(x in test_list for x in sub_list)): 
  flag = True
Posted by: Guest on April-07-2020
0

check if set is a subset of another python

A = {1, 2, 3}
B = {0, 1, 2, 3, 4, 5, 6}
Posted by: Guest on September-12-2021

Code answers related to "check if set is a subset of another python"

Python Answers by Framework

Browse Popular Code Answers by Language