I am trying to create a sorting system with ranking cards, and their values are obtained from a separate dictionary. In a simple deck of 52 cards, we have a rank from 2 to Ace, in this case I need a ranking system, where 0 is 10, J is 11, Q is 12, K is 13, A is 14 and 2 is 15, where 2 the largest ranked. The fact is that if there is a list where I want to sort the ranking cards in ASCENDING order in accordance with the numbering system, how to do it?
For example, here is a list,, [3,5,9,7,J,K,2,0]I want to sort the list into [3,5,7,9,0,J,K,2]. I also made a dictionary for the numbering system like {'A': 14, 'K': 13, 'J': 11, 'Q': 12, '0': 10, '2': 15}.
THANK
source
share