Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

| Download
Views: 17
def P(p,q): return not(p and not q) print P(True,True)
True
print P(True, False)
False
print P(False, True)
True
print P(False, False)
True
mitabla = [] encabezado = ["p", "q", "not q", "p and not q", "not( p and not q)"] mitabla.append(encabezado) for p in [True, False]: for q in [True, False]: renglon = [int(p), int(q), int(not q), int(p and not q), int(P(p,q))] mitabla.append(renglon) show(table(mitabla))
print(latex(table(mitabla)))
\begin{tabular}{lllll} p & q & not q & p and not q & not( p and not q) \\ $1$ & $1$ & $0$ & $0$ & $1$ \\ $1$ & $0$ & $1$ & $1$ & $0$ \\ $0$ & $1$ & $0$ & $0$ & $1$ \\ $0$ & $0$ & $1$ & $0$ & $1$ \\ \end{tabular}