Day 92 Default Code Broken

So the default code for day 92 is broken, specifically in requests.get(). Here’s what they give you:

import requests, json
timezone = "GMT"
latitude = 51.5002
longitude = -0.1262

result = requests.get(f"https://api.open-meteo.com/v1/forecast?latituude={latitude}&longitude={longitude}&daily=weathercode, temperature_2m_max, temperature_2m_min&timezone={timezone.upper()}")

user = result.json()
print(json.dumps(user, indent=2))

First off, latitude is misspelled as “latituude.” Second, there are spaces in the link.

Fixed version:

import requests, json
timezone = "GMT"
latitude = 51.5002
longitude = -0.1262

result = requests.get(f"https://api.open-meteo.com/v1/forecast?latitude={latitude}&longitude={longitude}&daily=weathercode,temperature_2m_max,temperature_2m_min&timezone={timezone.upper()}")

user = result.json()
print(json.dumps(user, indent=2))

Would definitely appreciate a fix for this in the repl.

1 Like

Great spot @QwertyQwerty54 thank you for letting us know.

I’ve got in touch with @david.morgan so that we can investigate and correct if needed!

1 Like

Sorry! It looks like a transcription error between the video and the text being written, all sorted now!

2 Likes