Selection Flashcards
Selection Blocks are all about making decisions
True/False?
True
Iterations gives flow control
True/False?
True
What statements are used for selection?
if, elif and else
Does the code move to the next block if the first if statement is false?
No, if the first or previous statement is false the code will end.
What type of structure do if statements follow?
They usually follow a IF-THEN-ELSE structure.
How many Booleans Expressions can be added to a condition?
As long as the overall expression evaluates to True/False then you can add more than one.
What is the ELSE-IF expression known in python?
elif
What are elif’s used for in python?
Elif’s are used to check multiple conditions and give different outputs depending on which condition is true.
What is a Nested IF Statement?
A Nested IF Statement is where an IF statement is inside another, this allows for multiple different outputs. The all you to check multiple conditions once the previous has been established as True/False
Why would a Nested IF Statement be better than an ELIF Statement?
It can be better where 2 or more outputs can be possible.