vendredi 26 novembre 2021

Writig the data on the same line

I want to write the other card's values in the same line with 'else'. E.g card number 2 equals 2, card number 3 equals 3...

btw from 1 to 13 is from ace to king and 15, 16, 17, 18 are suites.

def get_value(num, suit):
            if (suit == 18 or suit == 15) and num == 7:
                 return -21
            elif suit == 16 and num == 7:
                return -11
            elif num == 1 and (suit== 15 or suit==16 or suit==17 or suit==18):
                return 11
            elif (num == 12 or num == 13) and (suit== 15 or suit==16 or suit==17 or suit==18):
                return 10
            elif num == 11 and (suit== 15 or suit==16 or suit==17 or suit==18):
                return 25

Aucun commentaire:

Enregistrer un commentaire