From 7163ae3de62a4e9dfcfa32a77152f0aa4cec176b Mon Sep 17 00:00:00 2001 From: lyncir Date: Mon, 31 Oct 2016 18:45:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...thon\346\225\260\346\215\256\346\250\241\345\236\213-2.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/\347\254\2541\347\253\240-python\346\225\260\346\215\256\346\250\241\345\236\213-2.md" "b/\347\254\2541\347\253\240-python\346\225\260\346\215\256\346\250\241\345\236\213-2.md" index 98a2f2b..1db166c 100644 --- "a/\347\254\2541\347\253\240-python\346\225\260\346\215\256\346\250\241\345\236\213-2.md" +++ "b/\347\254\2541\347\253\240-python\346\225\260\346\215\256\346\250\241\345\236\213-2.md" @@ -53,8 +53,8 @@ False ``` suit_values = dict(spades=3, hearts=2, diamonds=1, clubs=0) def spades_high(card): -rank_value = FrenchDeck.ranks.index(card.rank) -return rank_value * len(suit_values) + suit_values[card.suit] + rank_value = FrenchDeck.ranks.index(card.rank) + return rank_value * len(suit_values) + suit_values[card.suit] ``` 有了spades_high函数,我们现在可以在我们的一副牌中增加列表排序: ```