<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_variable(self, variable, card=0):
 """ Add a variable to the model. Parameters: variable: any hashable python object card: int Representing the cardinality of the variable to be added. Examples: --------- """

        if variable not in self.variables:
            self.variables.append(variable)
        else:
            warn('Variable {var} already exists.'.format(var=variable))
        self.cardinalities[variable] = card
        self.transition_models[variable] = {}