(8)天气查询
import requests
key = 'xxx' #高德地图API
#天气查询
def weather(city:str):
parameters = {
'key':key,
'city':city,
}
r = requests.get('https://restapi.amap.com/v3/weather/weatherInfo?parameters',params=parameters)
data = r.json()
return data