"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)"
]
},
{
"source": [
"for name in boys.keys():\n",
" if 'king' == name:\n",
- " print(name + \" \" + str(ssadata.boys[name]))"
+ " print(name + \" \" + str(boys[name]))"
]
},
{
"source": [
"for name in girls.keys():\n",
" if 'queen' == name:\n",
- " print(name + \" \" + str(ssadata.girls[name]))"
+ " print(name + \" \" + str(girls[name]))"
]
},
{
"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?"
]
},
{
"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\")."
]
},
{
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.3"
+ "version": "3.7.4"
}
},
"nbformat": 4,