Boolean Expressions

How can we compare the truth value of two expressions? <insert method>

 

Can we compare truth value of two different data types? <string == int>

Can truth values have numbers? <1 = Truth, 0 = False>

If-else statement

How can we use boolean comparisons to achieve a conditional task? <insert if-else>

Is there a way to do nothing if a condition checks True? <pass>

Compound Boolean Expressions

Can we merge together multiple booleans? <and, or not>

 

Nested Conditions

Can we check more than one condition in one query? <a > 2 and a%2==0>

Is it a way to check for multiple ifs under one large if-statement? <nested ifs>

CS1302 Lecture 3

By Chung Chan

CS1302 Lecture 3

  • 115