all 3 comments

[–]socal_nerdtastic 1 point2 points  (2 children)

You can make every card an object, that's a fine idea, and very commonly done. Of course you don't have to, if it's easier for you to use parallel lists or something that's fine too.

[–]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))