[Solved] Need to implement the Python itertools function “chain” in a class

There is not (much) difference between def chain_for(*a): and def __init__(self, *a):. Hence, a very crude way to implement this can be: class chain_for: def __init__(self, *lists): self.lists = iter(lists) self.c = iter(next(self.lists)) def __iter__(self): while True: try: yield next(self.c) except StopIteration: try: self.c = iter(next(self.lists)) except StopIteration: break yield next(self.c) chain = chain_for([1, 2], … Read more

[Solved] Isolate a non duplicate of a chain separated by “,” from another longer chain in VBA [closed]

This function will work for you Function ReturnUnique(cell1 As Range, cell2 As Range) As String ReturnUnique = “” Dim v1 As Variant, v2 As Variant v1 = Split(cell1.Value, “,”) v2 = Split(cell2.Value, “,”) Dim i As Long, j As Long Dim bool As Boolean For i = LBound(v1, 1) To UBound(v1, 1) bool = True … Read more