2024-06-17 18:57:16 发布
网友
我将如何削减这一产出:
w = obs.get_weather() w.get_temperature() # Get temperature in Kelvin #output{'temp': 293.4, 'temp_kf': None, 'temp_max': 297.5, 'temp_min': 290.9}
为此:
293.4
您可以使用my_dictionary[键]获取字典值。对于您的代码,它将是: w.get_temperature()['temp']
w.get_temperature()['temp']
您可以使用my_dictionary[键]获取字典值。对于您的代码,它将是:
w.get_temperature()['temp']
相关问题 更多 >
编程相关推荐