Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nate Brunelle Today: Conditional Decision Statements

Similar presentations


Presentation on theme: "Nate Brunelle Today: Conditional Decision Statements"— Presentation transcript:

1 Nate Brunelle Today: Conditional Decision Statements
CS1110 Nate Brunelle Today: Conditional Decision Statements

2 Questions?

3 Last Time Functions Default Arguments

4 Expression vs. Statement
Expression: simplifies to a value 2 2+3 Amount_to_be_fancy(3**2) Statement: Does something x=3 print(‘Hello World!’)

5 Conditional decision Statement
if boolean expression: action elif boolean expression: else:

6 Conditional decision Statement
if boolean expression: action elif: another action else: yet another action 0 or more 0 or 1

7 Values and Types (not exhaustive)
Operators -50 ,0 ,5, 30, 512 int 3+7, 3*7, 3-7, 3/7 0.5, 1.2, float +, *, -, /, //, %, **, compare ‘hi’, “hi”, ‘hello world! ✃’ str +, * int Print, input function print() True, False bool and, or, not

8 and, or, not examples x<2 and x>0 x<0 or x>2 not x>2
When all things are true x<0 or x>2 When any of the things are true not x>2 When the thing is false

9 and, or, not and or not True if all things are True
False if any things are False or True if any things are True False if all things are False not True if the thing was False False if the thing was True


Download ppt "Nate Brunelle Today: Conditional Decision Statements"

Similar presentations


Ads by Google