From d501ee7cac67a5e4bd241acb841e27236009266d Mon Sep 17 00:00:00 2001 From: Camille Le Date: Sat, 29 Aug 2020 19:21:10 -0700 Subject: [PATCH 1/2] Fix country_dict[Sub-Region] because it throws errors --- Lesson07/Exercise93-94/Reading Data From API.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lesson07/Exercise93-94/Reading Data From API.ipynb b/Lesson07/Exercise93-94/Reading Data From API.ipynb index 6bc9029a..acedb464 100644 --- a/Lesson07/Exercise93-94/Reading Data From API.ipynb +++ b/Lesson07/Exercise93-94/Reading Data From API.ipynb @@ -60,13 +60,13 @@ " \"\"\"\n", " Function to get data about a country from \"https://restcountries.eu\" API\n", " \"\"\"\n", - " country_name=str(country)\n", + " country_name = str(country)\n", " url = serviceurl + country_name\n", " \n", " try: \n", " uh = urllib.request.urlopen(url)\n", " except HTTPError as e:\n", - " print(\"Sorry! Could not retrive anything on {}\".format(country_name))\n", + " print(\"Sorry! Could not retrieve anything on {}\".format(country_name))\n", " return None\n", " except URLError as e:\n", " print('Failed to reach a server.')\n", @@ -331,7 +331,7 @@ " country_dict['Country'].append(y['name'])\n", " country_dict['Capital'].append(y['capital'])\n", " country_dict['Region'].append(y['region'])\n", - " country_dict['Sub-region'].append(y['subregion'])\n", + " country_dict['Sub-Region'].append(y['subregion'])\n", " country_dict['Population'].append(y['population'])\n", " country_dict['Lattitude'].append(y['latlng'][0])\n", " country_dict['Longitude'].append(y['latlng'][1])\n", @@ -612,4 +612,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file From ae9cde3bcb344d0324c8fe125015c83a36d3bd93 Mon Sep 17 00:00:00 2001 From: Camille <31285549+camille-le@users.noreply.github.com> Date: Sat, 29 Aug 2020 19:28:24 -0700 Subject: [PATCH 2/2] Update Reading Data From API.ipynb --- Lesson07/Exercise93-94/Reading Data From API.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lesson07/Exercise93-94/Reading Data From API.ipynb b/Lesson07/Exercise93-94/Reading Data From API.ipynb index acedb464..f1d35bf3 100644 --- a/Lesson07/Exercise93-94/Reading Data From API.ipynb +++ b/Lesson07/Exercise93-94/Reading Data From API.ipynb @@ -612,4 +612,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +}