Invented George Boole (Cork 19th Century)
Boolean was useless until the advent of computers
| Symbol | Definition |
|---|---|
| == | is equal to |
| != | not equal to |
| < | less than |
| > | greater than |
| <= | less than or equal |
| >= | greater than or equal |
True or False
true=True
print(true)Megan = 16
Cathal = 16
Iustina = 17
Matthew = 17
Aine = 35
print(Aine > Cathal)
print(Megan < Aine)
print(Matthew > Iustina)
print(Matthew >= Iustina)
print(Cathal != Megan)event a
event b
a and b
True + True = True
a or b
True + False = True
False + True = True
a and not b
True + False = True
b and not a
False + True = True
Megan = 16
Cathal = 16
Iustina = 17
Matthew = 17
Aine = 35
one = (Cathal > Aine) #False
two = (Aine > Cathal) #this answer is True
three = (Matthew > Iustina) #False
four = (Matthew >= Iustina) #True
print(one and two)
print(two or three)
print(four and not two)
print(two and four)
print(two and not three)
print(one and two and three)
print(one or two or four)
print(three or not one)