Title: Simple Conditions
Course: CPS 120: Introduction to Computer Science ~ Master (Aug/2015) OLD > Section: Learning Units

- A relational operator is used to form a simple condition.
- A simple condition is either TRUE or FALSE.
- To determine the value of a simple condition:

1) Evaluate the expression on each side of the relational operator to get two constants.

2) Compare the two constants using the relational operator separating them:
✓ Two numeric expressions are equal if their values are equal.
✓ Two string expressions are equal if their corresponding characters are identical (same case) and they have the same length.
✓ Two Boolean expressions are equal if both values are True or both values are False.

Simple Condition Examples

5 < 6
78 >= 77
1 > (4 * 4)
101 != 101
"Chicago" != "Detroit"
"Chicago" == "chicago"
"DENVER" == "Denver"
"M" != "M"
False != True
Name == "Victoria"
X == 100
Y <= 417