final changes to A4 code

This commit is contained in:
K 2024-02-24 01:15:24 +05:30
parent 736f047a30
commit be62430a8b
Signed by: notkshitij
GPG Key ID: C5B8BC7530F8F43F

View File

@ -47,7 +47,7 @@ def size(Set):
print(f"Size of set is:\t{len(Set)}") print(f"Size of set is:\t{len(Set)}")
def iterator(setA): def iterator(setA):
a = iter(setA) a = iter(setA) # iter is a built-in function
for i in range(0,len(setA)-1): for i in range(0,len(setA)-1):
print(next(a),"->",end=' ') print(next(a),"->",end=' ')
print(next(a)) print(next(a))
@ -100,7 +100,7 @@ def main():
print("2 -> Remove value from set") print("2 -> Remove value from set")
print("3 -> Search value in set") print("3 -> Search value in set")
print("4 -> Show size of set") print("4 -> Show size of set")
print("5 -> Iterator (implementation pending)") print("5 -> Iterate")
print("6 -> Intersection of two sets") print("6 -> Intersection of two sets")
print("7 -> Union of two sets") print("7 -> Union of two sets")
print("8 -> Difference of two sets") print("8 -> Difference of two sets")