回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我希望得到最高的“高”出下面的dict。你知道吗</p>
<p><strong>响应</strong>=</p>
<pre><code> [
{
'timestamp':'2019-04-13T04:12:00.000Z',
'symbol':'XBTUSD',
'open':5065,
'high':5067,
'low':5065.5,
'close':5066.5,
'trades':13,
'volume':10002,
'vwap':5066.8829,
'lastSize':2,
'turnover':197408849,
'homeNotional':1.9740884899999998,
'foreignNotional':10002
},
{
'timestamp':'2019-04-13T04:11:00.000Z',
'symbol':'XBTUSD',
'open':5065,
'high':5065,
'low':5065,
'close':5065,
'trades':0,
'volume':0,
'vwap':None,
'lastSize':None,
'turnover':0,
'homeNotional':0,
'foreignNotional':0
},
{
'timestamp':'2019-04-13T04:10:00.000Z',
'symbol':'XBTUSD',
'open':5065,
'high':5065,
'low':5065,
'close':5065,
'trades':2,
'volume':2000,
'vwap':5065,
'lastSize':397,
'turnover':39486000,
'homeNotional':0.39486,
'foreignNotional':2000
}
]
</code></pre>
<p>然后要打印所有“high”:</p>
<pre><code>for h in response:
print (h['high'])
</code></pre>
<p>打印内容:</p>
<p><strong>5067个
5065
5065</strong></p>
<p>然后问题就出现了,我如何从数字列表中得到最大值?在这种情况下应该是“5067”。我试过用max方法,但没有用。<code>(max(h['high']))</code>不起作用。你知道吗</p>