Week 5 Flashcards
How do you make a conditional statement?
x =6
if x < 10
print “Hallo”
print “warum”
Maintain indent to indicate…
the scope of the block (which lines are affected by if/for)
What do Boolean expressions do?
ask a question and produce a yes or no result which we use to control programme flow.
What does this sign
<=
mean in Python
less than or equal
What does this sign
!=
mean in Python
not equal
What does this sign
==
mean in Python
equal to
What does this sign
>=
mean in Python
Greater than or equal
What does this sign
>
mean in Python
greater than
What does this sign
<
mean in Python
less than
What is conditional execution?
An execution with a condition in it
When do you increase indent?
after an “if” statement and for statement
Does Python care about how far a line is indented?
Yes, absolutely
What is a nested decision in Python?
More than 1 indentions
What is this?
x = 42
x > 1:
print “More than one”
if x < 100:
print “less than 100”
What is a two way decision?
something where we must choose one path or the other