class MyList(list): def __mul__(self, other): if isinstance(other, MyList): return MyList((x,y) for x in self for y in other) else: return super().__mul__(self, other) a = MyList([1, 2, 3]) b = MyList([4, 5, 6, 7]) print(a*b)
Standard input is empty