Lesson 3 - Tweaked

Lesson 3 - Python
Year 7 
1 / 24
suivant
Slide 1: Diapositive
ComputingLower Secondary (Key Stage 3)

Cette leçon contient 24 diapositives, avec quiz interactifs, diapositives de texte et 2 vidéos.

time-iconLa durée de la leçon est: 50 min

Éléments de cette leçon

Lesson 3 - Python
Year 7 

Slide 1 - Diapositive

KO: To be-able to explain what a conditions are in programming.
All 
- To be-able to explain what conditions are and how they are used in programming.

Most
- To be-able explain why conditions are important in programming.
- To be-able to explain how conditions can be used to validate a users input.

Some 
- To be-able demonstrate and show understanding of using conditions in your coding.

Slide 2 - Diapositive

Why is programming important?

Slide 3 - Carte mentale

What does a 'print' statement do in Python?
A
Stops the program
B
Displays output on the screen
C
Saves data to a file
D
Deletes code

Slide 4 - Quiz

What is a variable in Python?
A
A function in Python.
B
A loop in Python.
C
A named container for storing data.
D
An if statement in Python.

Slide 5 - Quiz

Can you...
Write a print statement saying your name e.g. "Joe Bloggs"?

Slide 6 - Diapositive

Can you...
Take an input from a user and use it in a sentence?

Slide 7 - Diapositive

Slide 8 - Vidéo

What is a condition?

Slide 9 - Question ouverte

 Condition
In Python, a condition is a statement that can be seen as either True or False.

Slide 10 - Diapositive

Slide 11 - Vidéo

Recap: Operators
The below are essential when programming...

Slide 12 - Diapositive

if, else - Example Program 

Slide 13 - Diapositive

if, else - Program Flowchart

Slide 14 - Diapositive

Let's take a look at the actual program...

Slide 15 - Diapositive

Let's look at why the program doesn't work properly!
Click here


'Make the students aware of data type casting'. This example is altered to show them!

Slide 16 - Diapositive

Making your own... 

Using the template above, can you 'Tweak' it? To make the below program.

The legal age to drive a car is 17 Years old.

If you can't drive, the code must print "You are not old enough to drive", 

If you can drive the code must print "You are old enough to drive".

Slide 17 - Diapositive

Driving Age: Solution

Slide 18 - Diapositive

if, else, elif - Example Program

Slide 19 - Diapositive

if, elif, else Statements

Slide 20 - Diapositive

if, elif, else Statements 

Slide 21 - Diapositive

How if, elif and else statements can be used

Slide 22 - Diapositive

Can you...
Can you create your own program that uses if, elif and else?

I want you to create a program where:

If - you enter your name it prints("That is an awesome name")
elif - you enter John it prints("That is a good name")
elif - you enter Harry it prints("That is an ok name")
else - it prints("That isn't a good name")

Slide 23 - Diapositive

What are conditional statements used for?
A
Breaking the code
B
Printing out all possible options
C
Making decisions based on certain conditions
D
Making the code run faster

Slide 24 - Quiz