added a few dictionary examples

master
manetta 4 years ago
parent ee301dfc97
commit e40474f84a

@ -646,7 +646,11 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"# Make an empty dictionary\n", "# Make an empty dictionary\n",
"dict = {}" "d = {}\n",
"\n",
"# or\n",
"\n",
"d = dict()"
] ]
}, },
{ {
@ -655,8 +659,8 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"dict['word'] = 10 \n", "d['word'] = 10 \n",
"print(dict)" "print(d)"
] ]
}, },
{ {
@ -665,7 +669,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"dict.keys()" "d.keys()"
] ]
}, },
{ {

Loading…
Cancel
Save