How to check if a set is a subset of another set in Python

1 Answer

0 votes
st1 = {'python', 'java', 'c', 'c++', 'c#'}
st2 = {'c', 'c++'}

if st2.issubset(st1):
  print('Subset')
else:
  print('Not a subset')





'''
run:

Subset

'''

 



answered Aug 10, 2022 by avibootz

Related questions

1 answer 121 views
1 answer 125 views
1 answer 141 views
1 answer 163 views
1 answer 117 views
...