<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def printPi(self):
 """ Prints all states state and their steady state probabilities. Not recommended for large state spaces. """

        assert self.pi is not None, "Calculate pi before calling printPi()"
        assert len(self.mapping)>0, "printPi() can only be used in combination with the direct or indirect method. Use print(mc.pi) if your subclass is called mc."        
        for key,state in self.mapping.items():
            print(state,self.pi[key])