Please enable JavaScript.
Coggle requires JavaScript to display documents.
Unit 2 - Coggle Diagram
Unit 2
Booleans
True
False
Examples
1<=2 = True 0==1 = False
Operations
Comparison
==
!=
<
Logical
not
Conditions are not true
not (y==b)
or
One or the other is true
y==b or y==a
and
Both conditions are true
y==z and a==b
If, else, elif
Is a statement true?
yes
Will print if statement
if a < b: print ("a= b")
no
one alternative:
will print else
else: print ("numbers are the same")
Multiple alternatives
Elif
is this statement true?
No
Yes
Will print elif
elif a > b: print ("c = b ")
if a < b:
print ("a= b")
elif a > b:
print ("c = b ")
else:
print ("numbers are the same")