Dlaczego klasa nie rozpoznaje atrybutu?

0
class Deck:
    def __int__(self):
        self.cards = []
        for i in range(2, 15):
            for j in range(4):
                self.cards.append(Card(i, j))
        shuffle(self.cards)


deck = Deck()
for card in deck.cards:
    print(card)

AttributeError: 'Deck' object has no attribute 'cards'
8

Masz literówkę:

 def __int__(self):

a powinno być init:

 def __init__(self):

1 użytkowników online, w tym zalogowanych: 0, gości: 1