gpt4 book ai didi

python 如何在我的方法调用中删除 None?

转载 作者:行者123 更新时间:2023-11-28 21:23:28 26 4
gpt4 key购买 nike

<分区>

我已经调用了这个方法,但是当数据返回时,它在数据下方返回一个 None。我怎样才能防止这种情况发生?

def weather_Connection(interval,apikey):


print print_forecast('Choa Chu Kang',get_response('/forecast/apikey/1.394557,103.746396'))
print print_forecast('Yishun',get_response('/forecast/apikey/1.429463,103.84022'))
print print_forecast('Redhill',get_response('/forecast/apikey/1.289732,103.81675'))
print print_forecast('Jalan Besar',get_response('/forecast/apikey/1.312426,103.854317'))
print print_forecast('Jurong West',get_response('/forecast/apikey/1.352008,103.698599'))
print print_forecast('Tampines',get_response('/forecast/apikey/1.353092,103.945229'))

数据以这种方式返回

cloudCover : 0.75
dewPoint: 24.87
humidity: 80.00
icon : partly-cloudy-night
ozone : 276.67
precipIntensity : 0
precipProbability : 0
pressure : 1009.61
summary : Dry and Mostly Cloudy
temperature: 28.56
visibility : 6.21
windBearing : 127
windSpeed : 4.57
psiAverage : 20
latitude : 1.394557
longitude : 103.746396
location : Choa Chu Kang
None

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com