Poker hand string display

前端 未结 4 1587
后悔当初
后悔当初 2021-01-21 18:19

I\'m brand new to programming and Python and I\'m trying my hardest to understand and learn it. I\'m not asking for answers but explanations in plain non-computer terms so that

4条回答
  •  面向向阳花
    2021-01-21 18:59

    You don't have much, but I'll say that your lists are in pairs.

    short_card = ['A', 'K', 'Q', 'J', 'T', '9', '8', '7', '6', '5', '4', '3', '2']
    long_card = ['ace', 'king', 'queen', 'jack', 'ten', 'nine', 'eight', 'seven', 'six', 'five', 'four', 'three', 'deuce']
    

    and

    short_suit = ['c', 'd', 'h', 's']
    long_suit = ['clubs', 'diamonds', 'hearts', 'spades'] 
    

    They're each the same length and in the same order. So the index of 'A' in short_card is the same as the index of 'ace' in long_card. So if you find the index of one, you have the index of the other.

    This should point you in the right direction. Come back and edit your post when you have more.

提交回复
热议问题