How to get a the difference of two sets as a new set in Python

1 Answer

0 votes
s1 = {"a", "b", "c", "d", "e"}
s2 = {"c", "e"}

s3 = s1.difference(s2)

print(s3)


'''
run:

{'a', 'b', 'd'}

'''

 



answered Dec 9, 2017 by avibootz

Related questions

1 answer 168 views
3 answers 253 views
1 answer 164 views
1 answer 114 views
1 answer 154 views
1 answer 137 views
...