Skip to content

Commit a11e242

Browse files
committed
update notebook for creating modules
1 parent cee704d commit a11e242

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

4_Problems/1_18_Modules.ipynb

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@
2525
"metadata": {},
2626
"outputs": [],
2727
"source": [
28-
"# Code Needed\n",
29-
"# Create salary_calculator.py with the following content\n",
30-
"def calculate_annual_salary(hourly_wage, hours_per_week):\n",
31-
" return hourly_wage * hours_per_week * 52"
28+
"%%writefile salary_calculator.py\n",
29+
"# write content of the cell to module salary_calculator"
3230
]
3331
},
3432
{
@@ -47,6 +45,17 @@
4745
"## 🟨 Filter Job Postings by Location (1.18.2)"
4846
]
4947
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": null,
51+
"id": "50c82097",
52+
"metadata": {},
53+
"outputs": [],
54+
"source": [
55+
"%%writefile job_filter.py\n",
56+
"# write content of the cell to module job_filter"
57+
]
58+
},
5059
{
5160
"cell_type": "code",
5261
"execution_count": null,
@@ -55,10 +64,6 @@
5564
"outputs": [],
5665
"source": [
5766
"# Code Needed\n",
58-
"# Create job_filter.py with the following content\n",
59-
"def filter_by_location(job_postings, location):\n",
60-
" return [job for job in job_postings if job['location'] == location]\n",
61-
"\n",
6267
"job_postings = [\n",
6368
" {'title': 'Data Scientist', 'location': 'New York'},\n",
6469
" {'title': 'Data Analyst', 'location': 'San Francisco'},\n",
@@ -75,7 +80,11 @@
7580
]
7681
}
7782
],
78-
"metadata": {},
83+
"metadata": {
84+
"language_info": {
85+
"name": "python"
86+
}
87+
},
7988
"nbformat": 4,
8089
"nbformat_minor": 5
8190
}

0 commit comments

Comments
 (0)