added A4
This commit is contained in:
parent
537edadc18
commit
21b3b3b128
@ -46,6 +46,12 @@ def size(Set):
|
|||||||
# Function to print size (length) of set
|
# Function to print size (length) of set
|
||||||
print(f"Size of set is:\t{len(Set)}")
|
print(f"Size of set is:\t{len(Set)}")
|
||||||
|
|
||||||
|
def iterator(setA):
|
||||||
|
a = iter(setA)
|
||||||
|
for i in range(0,len(setA)-1):
|
||||||
|
print(next(a),"->",end=' ')
|
||||||
|
print(next(a))
|
||||||
|
|
||||||
def intersection(setA, setB):
|
def intersection(setA, setB):
|
||||||
# Function to perform intersection of two sets
|
# Function to perform intersection of two sets
|
||||||
intersectionSet = []
|
intersectionSet = []
|
||||||
@ -54,12 +60,6 @@ def intersection(setA, setB):
|
|||||||
intersectionSet.append(i)
|
intersectionSet.append(i)
|
||||||
print(f"Intersection is:\t{intersectionSet}")
|
print(f"Intersection is:\t{intersectionSet}")
|
||||||
|
|
||||||
def iterator(setA):
|
|
||||||
a = iter(setA)
|
|
||||||
for i in range(0,len(setA)-1):
|
|
||||||
print(next(a),"->",end=' ')
|
|
||||||
print(next(a))
|
|
||||||
|
|
||||||
def union(setA, setB):
|
def union(setA, setB):
|
||||||
# Function to perform union of two sets
|
# Function to perform union of two sets
|
||||||
unionSet = []
|
unionSet = []
|
||||||
|
Loading…
Reference in New Issue
Block a user