DiscoverDharsan Decodes Data(Eng) S5 E4.1. Python essentials for DE
(Eng) S5 E4.1. Python essentials for DE

(Eng) S5 E4.1. Python essentials for DE

Update: 2026-01-29
Share

Description

pip install requests

import requests # Telling Python we want to use this power-up


# The "Waiter's" Address (A free API for current weather)

url = "https://api.open-meteo.com/v1/forecast?latitude=13.08&longitude=80.27¤t_weather=true"


# 1. Send the request

response = requests.get(url)


# 2. Convert the "mess" into a Python Dictionary

data = response.json()


# 3. Dig into the Dictionary to find the temperature

# (Based on the JSON structure the API provides)

current_temp = data["current_weather"]["temperature"]


print(f"The current temperature in Chennai is {current_temp}°C")

Comments 
loading
00:00
00:00
x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

(Eng) S5 E4.1. Python essentials for DE

(Eng) S5 E4.1. Python essentials for DE

Dharsan