擅长:python、mysql、java
<pre><code>for quote in quotes_results:
exit_fee_combined = quote.get('exitFeeA', 0) + quote.get('exitFeeB', 0)
</code></pre>
<p>在本例中,最简单的解决方案是正确选择<code>get</code>的结果。既然加0对数字没有影响,那就这么做吧。如果值是字符串,请使用<code>""</code>而不是<code>0</code></p>