diff --git a/content/03_stack.ipynb b/content/03_stack.ipynb index 28e9e1e..0554591 100644 --- a/content/03_stack.ipynb +++ b/content/03_stack.ipynb @@ -44,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 11, "id": "0e704969", "metadata": {}, "outputs": [], @@ -62,20 +62,26 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 73, "id": "102cacf7", "metadata": {}, "outputs": [], "source": [ "class Stack:\n", " def __init__(self): self.items = []\n", - " def __str__ (self): return \"\\n\".join(map(str, self.items[::-1]))\n", + " def __str__ (self): \n", + " ws = []\n", + " for i, item in enumerate(self.items[::-1]):\n", + " if i == 0 : ws.append(f\"{item}