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 174 views
3 answers 267 views
1 answer 169 views
1 answer 116 views
1 answer 159 views
1 answer 142 views
...