0

How would i go about cutting this output:

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}

To just this:

293.4
Daquaney
  • 47
  • 7

1 Answers1

0

You can get dictionary value by using my_dictionary[key]. For your code it will be: w.get_temperature()['temp']

Mikhail Sidorov
  • 1,325
  • 11
  • 15