Learning Objectives Students to be able to create
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 1 Friday, September 24, 2021 Creating Text Based Adventure Games/Stories 60 second entrance activity: What is an “if statement”?
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 2 Friday, September 24, 2021 Creating Text Based Adventure Games/Stories What is an “if statement”?
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 3 Friday, September 24, 2021 Learning Objective LO: Learn how to use “if statements” to create text-based game.
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 4 Friday, September 24, 2021 Learning Outcome By the end of this unit, we will have created a text-based adventure game/interactive story, with multiple endings.
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 5 Friday, September 24, 2021 “if Statements” Refresher if yourhaircolour == “brown”: Stand Up
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 6 Friday, September 24, 2021 “if Statements” Refresher if youreyecolour == “brown”: Stand Up
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 7 Friday, September 24, 2021 “if Statements” Refresher if yourhaircolour == “Blonde”: Stand Up
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 8 Friday, September 24, 2021 “if Statements” Refresher if youreyecolour == green: Stand Up
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 9 Friday, September 24, 2021 “if Statements” Refresher if yourgender = “female”: Stand Up
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 10 Friday, September 24, 2021 “if Statements” Refresher if yourhaircolour == “Black” Stand Up else Stay Seated
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 11 Friday, September 24, 2021 “if Statements” Refresher If yourhouse == “Newton”: Stand Up Elif yourhouse == “Lister”: Stand Up Else: Stay Seated
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 12 Friday, September 24, 2021 “if Statements” Refresher if yourhaircolour == “Black”: Sit Down else:
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 13 Friday, September 24, 2021 “if Statements” Refresher What We Need To Remember! Lowercase “if” if yourhaircolour == “Black”: Double equals sign means “is the same as” Sit Down elif yourhaircolour == “Brown”: Sit Down else: Sit Down Each statement NEEDS to end with a colon Each statement NEEDS an action Each action NEEDS to be indented
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 14 Friday, September 24, 2021 Password Challenge Write a program, in Python, that asks for a password and responds with: • “Access Granted” when the correct password is given. • “Access Denied” when an incorrect password is given. Extension Adapt the program to ask for, and check, both a username and password. HINT: There are two ways to do this, one adapting what we’ve learnt so far and one that use Boolean Logic operators, can you figure out how to do both?
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 15 Sample Code Friday, September 24, 2021
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 16 Friday, September 24, 2021 Creating Text Based Adventure Games/Stories What is a nested “if statement”?
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 17 Nested “if Statements” if yourhaircolour == “black”: Stand Up Friday, September 24, 2021
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 18 Nested “if Statements” if yourhaircolour == “black”: Stand Up elif yourhaircolour = “brown”: Put your hand up else: Do nothing Friday, September 24, 2021
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 19 Nested “if Statements” if yourhaircolour == “black”: Stand Up if youreyecolour ==“green” Put your left hand up elif yourhaircolour == “brown”: Put your right hand up if youreyecolour == “blue”: Put your left hand on your head else: Do nothing Friday, September 24, 2021
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 20 Friday, September 24, 2021 Nested “if Statements” if yourhaircolour == “black”: Stand Up if youreyecolour ==“green” Put your left hand up if yourage == 14: Put your right hand on your head if yourgender == “female”: Stand on one foot else: Put your right hand up
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 21 Friday, September 24, 2021 “if Statements” Refresher What We Need To Remember! Lowercase “if” if yourhaircolour == “Black”: Double equals sign means “is the same as” Sit Down elif yourhaircolour == “Brown”: Sit Down Each statement NEEDS to end with a colon else: Sit Down Each statement NEEDS an action Each action NEEDS to be indented
Learning Objectives • • Students to be able to create a program that asks for and checks a password. Students to be able to create a program that asks for and checks a username and password. Students will be able to explain the term Boolean. Students will be able to explain how Boolean operators work. Slide 22 Friday, September 24, 2021 “Nested if Statements” Refresher What We Need To Remember! Lowercase “if” if yourhaircolour == “Black”: Sit Down Double equals sign means “is the same as” if yourhaircolour == “Brown”: Sit Down Each statement NEEDS to end with a colon if yourhaircolour == “blonde": Sit Down Each “if statement” needs to be indented, level with action on line above. Each statement NEEDS an action
- Slides: 22