my_set = set([1,2,3,4,5])
print(my_set)
#another way of creating set
my_set = {1,2,3,4,5}
print(my_set)
#for empty set
my_set = {}
print(type(my_set))
#by this way it will create an empty dictionary
#To create empty set
my_set = set()
print(type(my_set))
#set removes duplicate values
my_set = {1,2,3,4,5,1,2,3}
print(my_set)
#adding 1 value to set
my_set.add(6)
print(my_set)
#adding multiple values to set
my_set.update([7,8,9])
print(my_set)
s2={9,10,11}
#updating set with another set
my_set.update(s2)
print(my_set)
#Removing values from set
my_set.remove(5)
print(my_set)
my_set.discard(6)
print(my_set)
#the difference between remove and discard method in sets is that discard won't throw an KeyError if the value doesn't exist but remove will
s1={1,2,3}
s2={2,3,4}
s3={3,4,5}
#values which are in s1 and s2
s4 = s1.intersection(s2)
print(s4)
#values which are in s1,s2 and s3
s4 = s1.intersection(s2,s3)
print(s4)
#valus which are in s1 but not in s2
s5=s1.difference(s2)
print(s5)
s5=s2.difference(s1,s3)
print(s5)
#no values in s2 which are not in s1 and s3
s5=s3.difference(s1,s2)
print(s5)
#this will return values which are unique in both set
s6=s1.symmetric_difference(s2)
print(s6)
employees = ['Corey','Jim','Steven','April','Judy','Jenn','John',"Jane"]
gym_members = ['April','John',"Corey"]
developers = ['Judy', 'Corey', 'Steven', 'Jane', 'April']
#Developers having gym membership
result = set(developers).intersection(gym_members)
print(result)
#employees that are not developers or gym members
result = set(employees).difference(gym_members,developers)
print(result)