1/20
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What does an equality condition check?
Whether two values are the same.
How do you write "is equal to" in code?
==
How do you write "not equal to" in code?
!=
What are relational operators used for?
To check whether values are higher or lower than each other.
What symbol means "less than"?
<
What symbol means "less than or equal to"?
<=
What symbol means "greater than"?
>
What symbol means "greater than or equal to"?
>=
What does the logical AND do?
It passes only if both left and right conditions are true.
What happens if one side of an AND is false?
The overall statement fails.
What does the logical OR do?
It passes if at least one of two conditions is true.
What are logical operators used for?
To group and evaluate multiple conditions using AND/OR.
What is an IF statement used for?
To perform an action when a condition is true.
What does the IF statement evaluate?
Whether a condition is true or false.
What happens when the condition in an IF statement is true?
The associated code is executed.
What is an ELSE used for in an IF statement?
To define what to do if the condition is not met.
What does IF/ELSE allow your code to do?
Follow different paths depending on whether the condition is met.
What happens if the IF condition is false?
The code in the ELSE block is executed.
What does ELSE IF (or ELIF) do?
Allows checking multiple conditions in sequence.
What happens if no IF or ELSE IF conditions are true?
The ELSE block (if present) is executed.
Why use ELSE IF or ELIF?
To test several conditions one by one until one is met.