diff --git a/Codes/Practical-A4.py b/Codes/Practical-A4.py index 380ba87..2a52e83 100644 --- a/Codes/Practical-A4.py +++ b/Codes/Practical-A4.py @@ -46,6 +46,12 @@ def size(Set): # Function to print size (length) of 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): # Function to perform intersection of two sets intersectionSet = [] @@ -54,12 +60,6 @@ def intersection(setA, setB): intersectionSet.append(i) 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): # Function to perform union of two sets unionSet = []