Unit 4 : Selection Structure Flashcards
1
Q
List out the selection structure in python ( 4 )
A
- One way decision
- Two way decision
- Multiway decision
- Nested decision
2
Q
What are comparison operators?
A
- It was boolean expressions ask a question and produce a Yes or No result which we use to control program flow
3
Q
What does comparison operators return?
A
- True ( Yes ) - False ( No )
4
Q
List out the Comparison Operators ( 6 )
A
- < Less Than
- <= Less Than or Equal
- == Equal To
- > = Greter Than or Equal
- > Greter Than
- != Not Equal
5
Q
What is nested decisions?
A
- There is if inside if
6
Q
When should we use two way decisions?
A
- If a logical expression is true and something else if the expression is false
7
Q
What is multi-way selection?
A
- Having another if when the above if statement is false
- Nested if is when the above if statement is true
8
Q
What can ignore identation? ( 2 )
A
- Blank lines
- Comments
9
Q
When do we need to increase indent ? ( 2 )
A
- Selection Structure ( if )
- Repetition Structure ( for )
- and many more
10
Q
When will try works? When will except works?
A
- When the code in try works
- When the code in try failed