Exemple #1
0
def main():
    n = 20
    for i in range(n):
        x = int(random() * 13) + 1
        y = int(random() * 4)
        suit = ['d', 's', 'h', 'c']
        card = Card(x, suit[y])
        print(card)
        print(card.BJValue())
        print()
def main():
    suitArray = ['Spades', 'Clubs', 'Diamonds', 'Hearts']
    n = eval(input("Enter the number of a cards to draw: "))
    score = 0
    for i in range(n):
        rank = random.randrange(1, 14)
        suit = random.choice(suitArray)
        card = Card(rank, suit, score)
        card.BJValue()
        print(card.__str__())
        score = card.score
    print("The Black Jack value of your cards is {0}".format(card.score))