----------------- Questions? Indentation Syntax branching if elif while Loops functions ----------------- ----------------- Understanding if if : ----------------- ----------------- Comparison Operators == equal to 5 == 5 True != not equal to 8 != 5 True > greater than 3 > 10 False < less than 5 < 8 True >= gte to 5 >= 10 False <= lte to 5 <= 5 True "ariel" == "ariel" True "ariel" == 5 False ----------------- ----------------- Understanding else if : else: password example ----------------- ----------------- Understanding elif if age > 60: print("You are older than 60") elif age < 30: print("You are younger than 30") else: print("You are between 30 and 60") mood example ----------------- ----------------- The while statement while : #evaluate condition #if condition is true execute this code #check condition again and exit if false print('Hello World') if the condition becomes false skip the block of code and continue the program at the first statement after the while loop ----------------- ----------------- Important steps for sentry variable 1. Initialize count = 10 2. Check while (count > 0) 3. Update count -= 1 (count = count - 1) ----------------- ----------------- # Countdown while loop n = input("Enter a number to start at: ") while n > 0: print(n) n = n-1 print("Blastoff!") mood with menu ----------------- ----------------- Functions def (): code block return # is return always required? ----------------- ----------------- square and sum of squares ----------------- ----------------- Exercises For Next Week: Chapter 3 - Challenge 2 Guess My number game with a limited number of guesses -----------------