擅长:python、mysql、java
<p>如何使用一个简单的列表理解消除手:</p>
<pre><code>for player in self.players:
player.hands = [hand for hand in player.hands if hand.smallest_value() <= 21]
</code></pre>
<p><strong>编辑</p>
<p>带过滤器:</p>
<pre><code>for player in self.players:
player.hands = filter(lambda x: x.smallest_value() <= 21, player.hands)
</code></pre>