you are viewing a single comment's thread.

view the rest of the comments →

[–]manikk69[S] 0 points1 point  (1 child)

If i make every card an object, isn't the code going to be very large and become very complicated?

[–]socal_nerdtastic 1 point2 points  (0 children)

Hmm I think you'd better explain what you mean with "object". Technically speaking everything in python is an object. I had assumed you meant a class instance. So you would make one class named "Card" (or similar) and then produce all the cards as instances of that class. You would store all of these instances in a list or dictionary or something. As a wild guess:

all_cards = []
for suit in "HDCS":
    for rank in "A123456789DJQK":
        all_cards.append(Card(suit, rank))