python implementation of the card game