class Card: """Card class for representing and manipulating one playing card""" def __init__(self, rank, suit): """A constructor method that sets the suit and rank""" self.suit = suit self.rank = rank self.value = self.assign_value(rank) def __str__(self): """Override the print method""" return self.rank + " of " + self.suit def get_suit(self): """A reader method that returns the suit of the card""" return self.suit def get_rank(self): """A reader method that returns the rank of the card""" return self.rank def get_value(self): """ A reader method that returns the blackjack value of the card""" return self.value def assign_value(self, rank): """A helper function to determine the blackjack value of a rank""" if rank == "ace": return 11 elif rank == "two": return 2 elif rank == "three": return 3 elif rank == "four": return 4 elif rank == "five": return 5 elif rank == "six": return 6 elif rank == "seven": return 7 elif rank == "eight": return 8 elif rank == "nine": return 9 else: return 10