140 likes | 234 Views
Do it now activity. Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”). Learning objectives. Homework. Pseudocode. You will be given a home learning sheet to complete for homework this term. Complete challenge 2
E N D
Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)
Learning objectives Homework Pseudocode You will be given a home learning sheet to complete for homework this term. Complete challenge 2 Your teacher will explain what you need to do. Due:
AIM Understand how to use nested if statements in your programming
Learning objectives Use nested if, elif, else function Correctly identify the flow of data through a program
Learning outcomes By the end of this lesson you will be able to ....
Use nested if, elif, else function Correctly identify the flow of data through a program Learning objectives New Learning Can you identify who did the crime? Nested Selection statement If Else Elif Condition Boolean Negation
Use nested if, elif, else function Correctly identify the flow of data through a program Learning objectives New Learning • Download and investigate the program called ‘nested selection statements’ from • www.Y8computing.weebly.com • Term 4 • Lesson 5 Nested Selection statement If Else Elif Condition Boolean Negation
Use nested if, elif, else function Correctly identify the flow of data through a program Learning objectives Independent task Can you adapt the code to: Check if the user has entered a correct username and password? Username = DsmithPassword = teapot Can you use negation for this? Nested Selection statement If Else Elif Condition Boolean Negation
Use nested if, elif, else function Correctly identify the flow of data through a program Learning objectives Independent task You can use and to check if more than one statement is true ie if name == “Dave” and age == 12: Can you use this in your program? Nested Selection statement If Else Elif Condition Boolean Negation
Copy Keyword Use nested if, elif, else function Correctly identify the flow of data through a program Learning objectives Copy Keyword Nesting: When control structures are inserted within other control structures. Nested Selection statement If Else Elif Condition Boolean Negation
Use nested if, elif, else function Correctly identify the flow of data through a program Learning objectives Talk task Why did you need to create a nested selection statement for this task? Why did you need to create an else statement that was outside of the nesting? Nested Selection statement If Else Elif Condition Boolean Negation
Plenary Use nested if, elif, else function Correctly identify the flow of data through a program Learning objectives Three stars and a wish. Nested Selection statement If Else Elif Condition Boolean Negation
Learning outcomes I can ....