def test_as_string(self):
     test_card = Card("A", "H", 14)
     self.assertEqual(test_card.as_string(), "A:H")
Exemple #2
0
                    self.__rank
                )  # if you give me anything other than an int i will return an error and initialize it as a 1
            except ValueError:
                self.__rank = 1
        if self.__rank < 1 or self.__rank > 13:  # outside the range it will initiaze as 1, deals with the invariance
            self.__rank = 1
        self.__suit = suit


# interactive

import card
from card import Card  # import the class called Card

a_card = Card()
print(a_card.as_string())

a_card.__rank = 10  # cant modify the private attribute

#interactive witht he seond once

import card
from card import Card

Card('A')

print(Card('A'))

a_card - Card()  #give me a card
print(a_card)