.
:
(_ /)
, . :
dict = {key_1: value_1, key_2: value_2,...... key_n: value_n}
1. .
:
print dict [key_1] #output will be returned value_1
- Then you can convert the returned data to integer or float. To convert to an integer:
Int (your_data) convert to float: Float (your_data)
If this is not a dictionary, you need to convert it to a dictionary or json via:
json.loads (return object)
In your case, you can do:
variable = client.get_spot_price()
print type(variable)
print float(variable["amount"])
source
share