Comparisons

The comparison num<10 was the condition in the while loop of the previous section. There are many other comparisons that can be used as conditions after a while. Here is a list of comparison operators and their meanings.

comparison example truth
< 3<xtrue if 3 is less than x
<= 3<=xtrue if 3 is less than or equal to x
> 3>xtrue if 3 is greater than x
>= 3>=xtrue if 3 is greater than or equal to x
!= 3!=xtrue if 3 is not equal to x
== 3==xtrue if 3 is equal to x