<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Content provided under a Creative Commons Attribution license, CC-BY 4.0. Bong-Sik Kim. (25 September, 2016)
Fundamentals of Logic
The connection between logic, proofs and programming is a very rich and interesting field that goes far byond the scope of an introductory course in discrete mathematics. But instead of illustrating this point here by introducing loads of material not covered in the text book, we will limit our ambitionsto simply emphasizing the obvious
Step1:  To get more intuition, let's consider the code segment that generates the truth table for the expression $\neg p \wedge (q\vee r)$
Step2:  Other connectives can easily be encoded as functions by use of the if statement. The implication arrow, for example, may be defined as follows
Step3:  To express the logical statement $x\geq 0 \wedge y\geq 0 \rightarrow x*y\geq 0$ in Python one simply writes
<ASSISTANT_TASK:>
Python Code:
for p in (True, False):
    for q in (True, False):
        print("%10s %10s %10s" %(p, q, (p and q)))
Explanation: Content provided under a Creative Commons Attribution license, CC-BY 4.0. Bong-Sik Kim. (25 September, 2016)
Fundamentals of Logic
The connection between logic, proofs and programming is a very rich and interesting field that goes far byond the scope of an introductory course in discrete mathematics. But instead of illustrating this point here by introducing loads of material not covered in the text book, we will limit our ambitionsto simply emphasizing the obvious: the similarities between logical truth values and Python’s boolean type and its operations. 
In Python terms, a logical statement is an expression of boolean type, such as $3 < 7$. Variables can be used in such expressions, although it should be noted that every variable will stand for some concrete value at run-time. 
Of the logical connectives, Python directly supports conjunction and disjunction in terms of the built-in primitives and and or, as well as negation via the primitive not (for more details, see the section "Booleans - AND, OR" in the note Introduction to Python Programming).  
A nested loop can be constructed to generate the truth table for standard logic operators such as the and
End of explanation
for p in (True, False):
    for q in (True, False):
        for r in (True, False):
            print("%10s %10s %10s %s" %(p, q, r, not p and (q or r)))
Explanation: To get more intuition, let's consider the code segment that generates the truth table for the expression $\neg p \wedge (q\vee r)$
End of explanation
def implies(a, b):
    if a:
         return b
    else:
         return True
Explanation: Other connectives can easily be encoded as functions by use of the if statement. The implication arrow, for example, may be defined as follows:
End of explanation
x = 4
y = -1
implies(x >= 0 and y >= 0, x*y >= 0)
Explanation: To express the logical statement $x\geq 0 \wedge y\geq 0 \rightarrow x*y\geq 0$ in Python one simply writes
End of explanation
<END_TASK>