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 213 views
1 answer 215 views
1 answer 242 views
1 answer 263 views
1 answer 195 views
...