<blockquote>
<p><strong>Possible Duplicate:</strong><br/>
<a href="https://stackoverflow.com/questions/4170238/poker-hand-string-display">Poker hand string display</a> </p>
</blockquote>
<p>嗨,所有我有点困难的时间来解决这个问题。因此,如果我能得到任何帮助,我将不胜感激。问题是</p>
<p>创建函数card_str(c)和hand_str(h),它们返回一张卡片的字符串版本和一个
分别是卡片。一张卡片是由两个字符组成的字符串:一个等级后跟一个西装。手是一张清单
卡。在</p>
<pre><code>>>> print card_str("Kh")
king of hearts
>>> print hand_str([’Kh’, ’As’, ’5d’, ’2c’])
king of hearts, ace of spades, five of diamonds, deuce of clubs
</code></pre>
<p>谢谢你的时间和解释。在</p>
<p>一个好的开始是写出一些或全部的输入输出对。在</p>
<p>所以你可以从以下几点开始:</p>
<pre><code>Kh king of hearts
As ace of spades
...
</code></pre>
<p>一旦你有了那张表,你就可以找到共同点:模式。一旦你找到了,就把它编码!在</p>