D
D
DavidDavidrrrr2021-06-15 11:34:32
Python
DavidDavidrrrr, 2021-06-15 11:34:32

How to replace " with single quote python json here code?

import requests
import json
response = requests.get(" https://api.openweathermap.org/data/2.5/weather?q=... ")
r = response.json()["main"]
print(r)
data = json.loads(r)
print(data['temp'])

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-06-15
@SoreMix

And what do you want then? If we take the temperature, then

import requests
response = requests.get("https://api.openweathermap.org/data/2.5/weather?q=london&appid=275a679565366751879b0bddec1367fc")
main = response.json()["main"]
print(main['temp'])
print(main)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question