Unit 4 : Selection Structure Flashcards

1
Q

List out the selection structure in python ( 4 )

A
  1. One way decision
  2. Two way decision
  3. Multiway decision
  4. Nested decision
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are comparison operators?

A
  1. It was boolean expressions ask a question and produce a Yes or No result which we use to control program flow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does comparison operators return?

A
  1. True ( Yes ) - False ( No )
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

List out the Comparison Operators ( 6 )

A
  1. < Less Than
  2. <= Less Than or Equal
  3. == Equal To
  4. > = Greter Than or Equal
  5. > Greter Than
  6. != Not Equal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is nested decisions?

A
  1. There is if inside if
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When should we use two way decisions?

A
  1. If a logical expression is true and something else if the expression is false
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is multi-way selection?

A
  1. Having another if when the above if statement is false
  • Nested if is when the above if statement is true
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What can ignore identation? ( 2 )

A
  1. Blank lines
  2. Comments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When do we need to increase indent ? ( 2 )

A
  1. Selection Structure ( if )
  2. Repetition Structure ( for )
  • and many more
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When will try works? When will except works?

A
  1. When the code in try works
  2. When the code in try failed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly