Is there a better way to do this?This function takes, as an argument, a natural number, n, which is between 1 and 52 inclusive and returns a list containing the point value associated with that number as an integer. The aces are the numbers 1,14,27,40 in the respective suits and they worth either 1 or 11 points. The regular cards with the numbers 2-10,15-23,28-36,41-49 in their respective suits are worth their face values. The face cardsare represented by the numbers 11-13,24-26,37-39,50-52 in their respective suits and they are each worth 10 points.def getPoints(n):    #the ace values    if n == 1 or n == 14 or n == 27 or n == 40:        return [1,11]    #the regular card values    if 2<=n<=10:        return [n]    if n == 15 or n == 28 or n == 41:        return [2]    if n == 16 or n == 29 or n == 42:        return [3]    if n == 17 or n == 30 or n == 43:        return [4]    if n == 18 or n == 31 or n == 44:        return [5]    if n == 19 or n == 32 or n == 45:        return [6]    if n == 20 or n == 33 or n == 46:        return [7]    if n == 21 or n == 34 or n == 47:        return [8]    if n == 22 or n == 35 or n == 48:        return [9]    if n == 23 or n == 36 or n == 49:        return [10]    if 11<=n<=13 or 24<=n<=26 or 37<=n<=39 or 50<=n<=52:        return [10]
Assigning card values
python;playing cards
Instead of making a function that maps a number from 1 to 52 you can reduce your domain to 1 to 13, and use modulo 13 to every number. That will reduce 75% of your conditions. It is done with a bit of modulo math.Then this function becomes quite short:def getPoints(n):    n = (n-1) % 13 + 1    #the ace values    if n == 1:        return [1,11]    #the regular card values    if 2<=n<=10:        return [n]    if 11<=n<=13:        return [10]