From: Jeremy Foote Date: Tue, 19 May 2020 19:41:50 +0000 (-0400) Subject: Fixing some typos; clarifying final exercise X-Git-Url: https://projects.mako.cc/source/babynames-cdsw/commitdiff_plain/26e2912f216aa70f26fefa1e774a5174085ad508?hp=26ccc03ee2f79110efa5d01e862d4c3abc8c9858 Fixing some typos; clarifying final exercise --- diff --git a/BabyNames.ipynb b/BabyNames.ipynb index 8e3d040..8173933 100644 --- a/BabyNames.ipynb +++ b/BabyNames.ipynb @@ -29,7 +29,7 @@ "source": [ "for name in boys.keys():\n", " if name == \"mako\":\n", - " print(\"There were \" + str(ssadata.boys[name]) + \" boys named \" + name)" + " print(\"There were \" + str(boys[name]) + \" boys named \" + name)" ] }, { @@ -67,7 +67,7 @@ "source": [ "for name in boys.keys():\n", " if 'king' == name:\n", - " print(name + \" \" + str(ssadata.boys[name]))" + " print(name + \" \" + str(boys[name]))" ] }, { @@ -85,7 +85,7 @@ "source": [ "for name in girls.keys():\n", " if 'queen' == name:\n", - " print(name + \" \" + str(ssadata.girls[name]))" + " print(name + \" \" + str(girls[name]))" ] }, { @@ -180,8 +180,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "How many boys' names are also girls' names? How many girls' names are also boys' name\n", - "s?\n" + "How many boys' names are also girls' names? How many girls' names are also boys' names?" ] }, { @@ -224,7 +223,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Take a prefix as input and print the number of boys and girls with that prefix (i.e., \"m\" would list babies whose names start with \"m\" and \"ma\" would list babies whose names start with \"ma\", etc).\n" + "Write a function that takes a prefix as input and prints the number of boys and girls with that prefix (e.g., get_names(\"m\") would list all names that start with \"m\" and get_names(\"ma\") would only list those that start with \"ma\")." ] }, { @@ -251,7 +250,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.7.4" } }, "nbformat": 4,