In [1]:

```
print "The following sentences are Propositions" #Proposition should be a declarative sentence or should result in either a YES or a NO.
print "1. Washington D.C is the capital of the United States of America\n2. Toronto is the capital of Canada\n3. 1+1=2.\n4. 2+2=3." #Since these statements are declarative and they answer the question YES or NO they are called propositions.
```

In [2]:

```
print "1. What time is it? \n2. Read this carefully. \n3. x+1=2.\n4. x+y=Z."
print"Sentences 1 and 2 are not propositions since they are not declarative. Sentences 3 and 4 are neither true nor false and so they are not propositions."
```

In [9]:

```
print "Propositon p=Michael's PC runs Linux."
print "\n Negation of p is ~p : It is not the case that Michael's PC runs Linux."
print "\n Negation of p is ~p : Michae's PC does not run."#Negation is opposite of the truth value of the proposition expressed with "it is not the case that" or with "not".
```

In [10]:

```
print "Let p=Vandana's smartphone has at least 32GB of memory."
print "The negation of p is ( ~p ) :It is not the case that Vandana's smartphone has at least 32GB of memory."
print "Or in simple English ( ~p ): Vandana's smartphone does not have at least 32GB of memory."
print "Or even more simple as ( ~p ): Vandana's smartphone has less than 32GB of memory."
```

In [11]:

```
p="Rebecca's PC has more than 16GB free hard disk space"
q="The processor in Rebecca's PC runs faster than 1GHz"
print "Let p,q be two propositions"
print "Let p=",p,"\n","Let q=",q
print "Conjunction of p^q is : "+p+" and "+q #conjunction combines two propositons with "and"
```

In [12]:

```
p="Rebecca's PC has more than 16GB free hard disk space"
q="The processor in Rebecca's PC runs faster than 1GHz"
print "Let p,q be two propositions"
print "Let p=",p,"\n","Let q=",q
print "Disjunction of p\/q is : "+p+" or "+q #unavailability of cup symbol. So \/
#Disjunction combines two propositons using OR
```

In [14]:

```
p="Maria learns discrete mathematics"
q="Maria will find a good job"
print"Let p=",p,"\n","Let q=",q
print"p->q is : "+"If "+p+" then "+q #p->q p implies q means If P then Q.
print"p->q is also expressed as :",q," when ",p
```

In [15]:

```
def p(x): #Function defined to check whether the given statements are true.
if(x>3):
print "p(",x,") which is the statement",x,">3, is true"
else:
print "p(",x,") which is the statement",x,">3, is false"
p(4)#Fuction call
p(2)
```

In [17]:

```
x1="CS1" #Defining systems to check whether they are under attack through a function.
x2="CS2"
x3="MATH1"
def A(x):
if(x=="CS1"): #Since cs1 and Math1 are the two computers under attack
print "A(",x,") is true."
else:
if(x=="MATH1"): #Since CS1 and MATH1 are the two computers under attack
print "A(",x,") is true."
else:
print"A(",x,") is false."
print "Systems under attack are CS1 and MATH1. The truth values for the same are calculated using functions."
A(x1)#Function call
A(x2)
A(x3)
```