From e40474f84ad059e0b267b149962bcaee8a120a24 Mon Sep 17 00:00:00 2001 From: manetta Date: Mon, 2 Nov 2020 16:51:45 +0000 Subject: [PATCH] added a few dictionary examples --- python-cheatsheet.ipynb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python-cheatsheet.ipynb b/python-cheatsheet.ipynb index f81ee8b..7e32a05 100644 --- a/python-cheatsheet.ipynb +++ b/python-cheatsheet.ipynb @@ -646,7 +646,11 @@ "outputs": [], "source": [ "# Make an empty dictionary\n", - "dict = {}" + "d = {}\n", + "\n", + "# or\n", + "\n", + "d = dict()" ] }, { @@ -655,8 +659,8 @@ "metadata": {}, "outputs": [], "source": [ - "dict['word'] = 10 \n", - "print(dict)" + "d['word'] = 10 \n", + "print(d)" ] }, { @@ -665,7 +669,7 @@ "metadata": {}, "outputs": [], "source": [ - "dict.keys()" + "d.keys()" ] }, {