Latest Update Straight from the North Pole!
Thanks to your help with yesterday’s list-sorting task, we’ve uncovered another urgent matter that needs your coding expertise! Santa’s sleigh must stop for some vital magical maintenance before Christmas Eve, and we need you to identify these specific locations.
The Task
Santa has 9 important maintenance stops around the globe. At each stop, he’ll take care of:
Your Coding Challenge
Create a program that:
The Coordinates
What Your Program Must Do
Sample Output Format
🎄 Tracking Santa's Maintenance Stops 🎄
Santa is making maintenance stops in these countries:
Checkpoint 1: [Country Name]
Checkpoint 2: [Country Name]
...etc
🌟 A Magical Hint 🌟
There’s something special about these maintenance stops... once you discover the countries, pay close attention—there might be a festive surprise in the letters you collect!
Don’t forget this secret word; you’ll need it for the grand finale on Day 5!
Pro Tips
Thanks to your help with yesterday’s list-sorting task, we’ve uncovered another urgent matter that needs your coding expertise! Santa’s sleigh must stop for some vital magical maintenance before Christmas Eve, and we need you to identify these specific locations.
The Task
Santa has 9 important maintenance stops around the globe. At each stop, he’ll take care of:
- Resting the reindeer
- Refilling magic dust
- Tuning the sleigh bells
- Expanding present storage
- Topping up cookie fuel
Your Coding Challenge
Create a program that:
- Connects to a geocoding API (like Nominatim).
- Uses each stop’s latitude/longitude.
- Tells Santa the country for each stop.
The Coordinates
Code:
checkpoints = [
{"lat": 45.4215, "long": -75.6972}, # Stop 1
{"lat": 47.1625, "long": 19.5033}, # Stop 2
{"lat": 55.7558, "long": 37.6173}, # Stop 3
{"lat": 41.8719, "long": 12.5674}, # Stop 4
{"lat": 40.4637, "long": -3.7492}, # Stop 5
{"lat": 39.9334, "long": 32.8597}, # Stop 6
{"lat": 47.4979, "long": 19.0402}, # Stop 7
{"lat": 41.8719, "long": 12.5674}, # Stop 8
{"lat": 40.4637, "long": -3.7492} # Stop 9
]
What Your Program Must Do
- Use Python’s requests library.
- Properly handle and validate responses from the API.
- Display the name of each country in English.
- Clearly number each maintenance stop in your output.
Sample Output Format
🎄 Tracking Santa's Maintenance Stops 🎄
Santa is making maintenance stops in these countries:
Checkpoint 1: [Country Name]
Checkpoint 2: [Country Name]
...etc
🌟 A Magical Hint 🌟
There’s something special about these maintenance stops... once you discover the countries, pay close attention—there might be a festive surprise in the letters you collect!
Don’t forget this secret word; you’ll need it for the grand finale on Day 5!
Pro Tips
- Include accept-language=en in your API requests to ensure you receive English results.
- Add a short pause (e.g., time.sleep(1)) between calls to be polite to the API.
- Some coordinates appear multiple times—this is on purpose!