Last active
October 25, 2018 08:09
-
-
Save nutchy/74d25a6e69e10c6ac39d90bcfd1baa28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Finding Card """ | |
def cardAt(num): | |
""" | |
This function will return card at position num | |
Example : | |
========================== | |
| Input | Output | | |
========================== | |
| 0 | 2C | | |
| 1 | 3C | | |
| 34 | 0H | | |
========================== | |
""" | |
# Declaration rank and suit of face card | |
suit = "CDHS" | |
ranking = "234567890JQKA" | |
return ranking[num%13] + suit[num//13] | |
print(cardAt(int(input('Input a number : ')))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment