from container import Container


def container_cycle(c, i):
    """
    Cycle i items through Container c.
        self._contents[self._key] = obj

    @param Container c: container to cycle through
    @param int i: number of items to cycle through c
    @rtype: None
    """
    for n in range(i):
        c.add(n)
    while not c.is_empty():
        print(c.remove())


if __name__ == "__main__":
    from stack import Stack
    from sack import Sack
    L = [Stack(), Sack()]
    for s in L:
        print("\nCycling through {}".format(s))
        container_cycle(s, 10)
