code: def truthtable(inputs, outputs):
      
      def items():
          """Convert all outputs to PC notation."""
          for output in outputs:
              if isinstance(output, boolfunc.Function):
                  output = output.unbox()
              if output in (0, '0'):
                  yield PC_ZERO
              elif output in (1, '1'):
                  yield PC_ONE
              elif output in "-xX":
                  yield PC_DC
              else:
                  fstr = "expected output in [01-xX], got {}"
                  raise ValueError(fstr.format(output))
      inputs = [ttvar(v.names, v.indices) for v in inputs]
      pcdata = PCData(items())
      if len(pcdata) != (1 << len(inputs)):
          fstr = "expected {} outputs, got {}"
          raise ValueError(fstr.format(1 << len(inputs), len(pcdata)))
      return _truthtable(inputs, pcdata)
docs: Return a truth table.