[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slim "functional solution" causing confusion #34

Open
hamishgibbs opened this issue Nov 9, 2023 · 0 comments
Open

Slim "functional solution" causing confusion #34

hamishgibbs opened this issue Nov 9, 2023 · 0 comments

Comments

@hamishgibbs
Copy link

There has been some confusion about Practical 3 Section 1.2.3. Students have been making the functional solution more complicated than it needs to be.

At the moment, the function is just a print statement – so could do with a clarification about how this, or could add the indexing into the function body (def city_avg_temp(city, temperatures).

Link:

{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 1.2.3 A Functional Solution \n",
"\n",
"Can you convert this to a simple function called `avg_tmp` with two inputs and then use this to print the average temperature for Edinburgh? "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def ??(??, temp):\n",
" print(f\"The average temperature in {??} is {temp}\")\n",
"\n",
"city=\"Edinburgh\"\n",
"avg_tmp(city, ??)"
]
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant