Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 717f00f

Browse files
committed
2 parents d7e6615 + 4f6d79f commit 717f00f

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

exercises/week_6/assignment/exercise.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In this assignment you are going to build a Python program to access the
44
[Apple iTunes Search Service](https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/iTuneSearchAPI/Searching.html).
55
This service can be used to search information about musicians, albums, songs and so on.
66

7-
Using the following URL a search for the term _ramones_ and for the entity type
7+
Using the following URL, a search for the term _ramones_ and for the entity type
88
_album_ is performed:
99
[https://itunes.apple.com/search?term=ramones&entity=album](https://itunes.apple.com/search?term=ramones&entity=album)
1010

@@ -33,16 +33,16 @@ example result of the service:
3333
]
3434
}
3535

36-
The response in the example above consist of one result (`resultCount` is 1). This result is the album
37-
"Ramones" (element `collectionName`) by the artist "Ramones" (element `artistName`)
36+
The response in the example above consists of one result (`resultCount` is 1). This result is the album
37+
"Ramones" (element `collectionName`) by the artist "Ramones" (element `artistName`).
3838
The response is in [JSON](https://en.wikipedia.org/wiki/JSON) format.
3939

4040
The [Requests](https://docs.python-requests.org/en/latest/)
4141
library can be used to invoke the Apple iTunes Search Service.
42-
In order to perform a search a [GET request](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods)
42+
In order to perform a search, a [GET request](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods)
4343
needs to be performed. This is done using the `get()` function of the Requests library.
44-
After that the method `json()` of the Requests
45-
library can be used to mapped the response from [JSON](https://en.wikipedia.org/wiki/JSON)
44+
After that, the method `json()` of the Requests
45+
library can be used to map the response from [JSON](https://en.wikipedia.org/wiki/JSON)
4646
to the Python 🐍 data types `dict` and `list`.
4747

4848
---
@@ -64,7 +64,7 @@ Below is an example execution of the program. Note that the output is abbreviate
6464
# Hints
6565

6666
1. In Code Ocean it is not possible to access the iTunes search API. Therefore you should
67-
write and test you program on your own computer e.g. in a Jupyter notebook.
68-
1. Out tests in Code Ocean uses a [mock object](https://en.wikipedia.org/wiki/Mock_object) to check
67+
write and test your program on your own computer e.g. in a Jupyter notebook.
68+
1. Our tests in Code Ocean use a [mock object](https://en.wikipedia.org/wiki/Mock_object) to check
6969
your program. Therefore only the `get()` function and the `json()` method are supported. All other
70-
functions and methods of the Requests library will **not** work.
70+
functions and methods of the Requests library will **not** work.

exercises/week_6/assignment/functional_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def runcaptured(tracing=None, variables=None):
4949
return source, out[0], out[1], variables
5050

5151

52-
class RefernceSolution:
52+
class ReferenceSolution:
5353
def search_itunes(self, search_term):
5454
import requests
5555

@@ -75,7 +75,7 @@ def test_search_gold(self, mocked_input):
7575
mock_request.return_value.json.return_value = json.loads(f.read())
7676
mock_request.return_value.status_code = 200
7777

78-
result_count, albums = RefernceSolution().search_itunes("gold")
78+
result_count, albums = ReferenceSolution().search_itunes("gold")
7979

8080
with mock.patch("requests.get") as mock_request:
8181
with open("mock_search_result_gold.json") as f:
@@ -139,7 +139,7 @@ def test_search_random(self, mocked_input):
139139
mock_request.return_value.json.return_value = json.loads(f.read())
140140
mock_request.return_value.status_code = 200
141141

142-
result_count, albums = RefernceSolution().search_itunes(search_term)
142+
result_count, albums = ReferenceSolution().search_itunes(search_term)
143143

144144
with mock.patch("requests.get") as mock_request:
145145
with open(f"mock_search_result_{search_term}.json") as f:

notebooks/week_6/week_6_unit_2_importlibraries_notebook.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"In the example above, the functions [sin()](https://docs.python.org/3/library/math.html#math.sin),\n",
8787
"[cos()](https://docs.python.org/3/library/math.html#math.cos) and\n",
8888
"[pow()](https://docs.python.org/3/library/math.html#math.pow) are used to calculate the\n",
89-
"[Pythagorean Identity](ttps://en.wikipedia.org/wiki/Pythagorean_trigonometric_identity) $(sin(x))^2 + (cos(x))^2 = 1$. Of course it would also be possible to use `**` instead of the `pow()` function.\n",
89+
"[Pythagorean Identity](https://en.wikipedia.org/wiki/Pythagorean_trigonometric_identity) $(sin(x))^2 + (cos(x))^2 = 1$. Of course it would also be possible to use `**` instead of the `pow()` function.\n",
9090
"The `pow()` function was used here to show an additional function from the `math` library.\n",
9191
"\n",
9292
"## Partially importing libraries\n",

0 commit comments

Comments
 (0)