Set1 = {2,3,5,7}
print(Set1[2])
#########
alphabet = ["a","b","c","d"]
alphabet_set = set(alphabet)
print(alphabet_set)
alphabet[2]
alphabet_set[2]

type(alphabet)

type(alphabet_set)

Program = {"python","C","java"}
print(Program)
{'C', 'java', 'python'}
>>> Program.copy()
{'C', 'java', 'python'}
>>> Program.add("open CV")
>>> print(Program)
{'C', 'java', 'open CV', 'python'}
>>> Program.clear()
>>> print(Program)
set()
>>> Program = {"python","C","java"}
>>> Program.add("Open cv")
>>> Program
{'C', 'java', 'python', 'Open cv'}
>>> Program.remove("java")
>>> print(Program)
{'C', 'python', 'Open cv'}
>>> Program.remove("Python")
Traceback (most recent call last):
  File "<pyshell#21>", line 1, in <module>
    Program.remove("Python")
KeyError: 'Python'
>>> Program.remove("java")
Traceback (most recent call last):
  File "<pyshell#22>", line 1, in <module>
    Program.remove("java")
KeyError: 'java'
>>> Program.discard("java")
>>> print(Program)
{'C', 'python', 'Open cv'}
>>> Program.discard("C")
>>> Program
{'python', 'Open cv'}
>>> Program.add("matlab")
>>> Program
{'matlab', 'python', 'Open cv'}
>>> Program.pop()
'matlab'
>>> Program
{'python', 'Open cv'}
>>> Program.pop()
'python'
>>> Program
{'Open cv'}
>>> Program.pop()
'Open cv'
>>> Program
set()
Program.pop()
######################
########################################### Methods #################################
###############
Set1 = {"python","C","java"}
>>> Set2 = set(["mehr","aban","azar"])
>>> Set3 = set(["bahman","day","tir","aban"])
>>> print(Set2)
{'azar', 'aban', 'mehr'}
>>> Set3
{'day', 'bahman', 'aban', 'tir'}
>>> Set1.isdisjoint(Set2)
True
>>> Set1.isdisjoint(Set1)
False
>>> Set2.isdisjoint(Set3)
False
>>> Set1.issubset(Set2)
False
>>> Set2.issubset(Set2)
True
>>> Set2.issubset(Set3)
False
>>> Set1.issuperset(Set2)
False
>>> Set4 = Set1.union(Set2)
>>> print(Set4)
{'azar', 'java', 'mehr', 'C', 'python', 'aban'}
>>> Set5 = Set2.union(Set3)
>>> Set5
{'azar', 'tir', 'mehr', 'day', 'bahman', 'aban'}
>>> Set6 = Set2.intersection(Set3)
>>> print("the intersection of set2 and set3 is: ", Set6)
the intersection of set2 and set3 is:  {'aban'}
>>> Set7 = Set2.intersection(Set1)
>>> Set7
set()
>>> Set8 = Set1.difference(Set2)
>>> print(Set8)
{'C', 'python', 'java'}
>>> Set9 = Set3.difference(Set2)
>>> Set9
{'day', 'bahman', 'tir'}
>>> Set10 = Set1.symmetric_difference(Set2)
>>> Set10
{'java', 'mehr', 'python', 'azar', 'C', 'aban'}
>>> Set11 = Set2.difference(Set1)
>>> Set11
{'azar', 'aban', 'mehr'}
>>> Set12 = Set3.symmetric_difference(Set2)
>>> Set12
{'day', 'azar', 'bahman', 'tir', 'mehr'}
>>> Set13 = Set2.union(Set3)
>>> Set13
{'azar', 'tir', 'mehr', 'day', 'bahman', 'aban'}
>>> Set14 = Set2.intersection(Set3)
>>> Set14
{'aban'}
>>> Set15 = Set13.difference(Set14)
>>> print(Set15)
