If-else Branches Flashcards
What is a branch?
A sequence of instructions that only executes if certain conditions are met.
How do you set up multiple branches?
With if elif else branches.
What are the relational operators?
<, >, <=, >=
What are the logical operators?
Not, and, or
What are nested if-else statements?
Placing if else statements inside other if else statements.
How are strings compared using relational operators?
Each character’s ASCII value is read until it finds a pair between each string that are greater or less than each other.
How are lists and tuples compared?
It compares each item in sequence.
How are dictionaries compared?
Dictionaries can only be compared using == and !=. They must have the same set of keys and values to be equal.