If-else Branches Flashcards

1
Q

What is a branch?

A

A sequence of instructions that only executes if certain conditions are met.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you set up multiple branches?

A

With if elif else branches.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the relational operators?

A

<, >, <=, >=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the logical operators?

A

Not, and, or

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are nested if-else statements?

A

Placing if else statements inside other if else statements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How are strings compared using relational operators?

A

Each character’s ASCII value is read until it finds a pair between each string that are greater or less than each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How are lists and tuples compared?

A

It compares each item in sequence.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How are dictionaries compared?

A

Dictionaries can only be compared using == and !=. They must have the same set of keys and values to be equal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly