Wat is LessonUp
Zoeken
Kanalen
Inloggen
Registreren
‹
Terug naar zoeken
Y8 Python - Low Ability - If Elif JM
Python
On the road to code!
1 / 40
volgende
Slide 1:
Tekstslide
Computing
Lower Secondary (Key Stage 3)
In deze les zitten
40 slides
, met
interactieve quizzen
,
tekstslides
en
3 videos
.
Start les
Bewaar
Deel
Printen
Onderdelen in deze les
Python
On the road to code!
Slide 1 - Tekstslide
What is Python Programming?
Slide 2 - Woordweb
Python
High level programming language
Allows you to create your own programs
Text based
Slide 3 - Tekstslide
KO - Learn to program with Python
All - Use the print function to output some text on the screen
Most - Create a variable that stores text data that can then be displayed on the screen in a story
Some - Can explain the link between machine code and high level language
Slide 4 - Tekstslide
Recall
Try these old recall questions on things you should know about programming
Slide 5 - Tekstslide
Code that runs one line after another is known as coding in...
A
Sequence
B
Selection
C
Iteration
D
Recursion
Slide 6 - Quizvraag
Code that repeats/loops is known as coding in...
A
Sequence
B
Selection
C
Iteration
D
Recursion
Slide 7 - Quizvraag
Code that only runs when a condition is met is known as coding in...
A
Sequence
B
Selection
C
Iteration
D
Recursion
Slide 8 - Quizvraag
An example of a loop in python would be:
A
print("this")
B
while x > 0 :
C
if x == 0 :
D
name = input("-->")
Slide 9 - Quizvraag
A value that is used by the program and can change is known as a...
A
constant
B
procedure
C
function
D
variable
Slide 10 - Quizvraag
Refresh
Time to refresh those skills
Slide 11 - Tekstslide
outputs
Used to output messages to the screen
In Python we use
print
print
(
"hello world"
)
Slide 12 - Tekstslide
Task 1 - Print statement
Link to Python interactive task
Link to support video
Slide 13 - Tekstslide
Variables
An area in memory used to store a value the program will use.
The value is likely to change
Here are some examples in Python
name =
"Dave"
- Text
health =
100
- Integer
discount =
False
- Boolean (True/False)
Slide 14 - Tekstslide
Inputs
We often use variables to store inputs from the user
In Python we use
input
input
(
"Question the user will see as a prompt"
)
So to store a name we would use:
name =
input
(
"What is your name ? --> "
)
Slide 15 - Tekstslide
KO - Learn to program with Python
All - Use the print function to output some text on the screen
Most - Create a variable that stores text data that can then be displayed on the screen in a story
Some - Can explain the link between machine code and high level language
Slide 16 - Tekstslide
Label the correct parts of this code (drag them - text at the bottom).
filmpref = input("What kind of films do you like? ")
Checkpoint
Variable
Function
Parameters
Slide 17 - Sleepvraag
Task 2 - Print Statements & inputs
Link to Python interactive task
Link to support video
Slide 18 - Tekstslide
CORRECT
CAUSE AN ERROR
print = ("Hello")
Print("Yes!")
print("this one)
name = imput("what is your name")
name = input("what is your name")
print("this text")
fav colour = "Green"
age = 10
print("Hello", name)
print("Bye",name")
Slide 19 - Sleepvraag
Python
Slide 20 - Tekstslide
create.withcode.uk
Slide 21 - Link
Starter
I want you to
print
to the screen using Python.
Can you
print
your favourite food to the screen.
Slide 22 - Tekstslide
KO - Learn to program with Python
All - Use the print function to output some text on the screen
Most - Create a variable that stores text data that can then be displayed on the screen in a story
Some - Can explain the link between machine code and high level language
Slide 23 - Tekstslide
Variables
An area in memory used to store a value the program will use.
The value is likely to change
Here are some examples in Python
name =
"Dave"
- Text
health =
100
- Integer
discount =
False
- Boolean (True/False)
Slide 24 - Tekstslide
Slide 25 - Video
IF/ELIF/ELSE
When we need to make a decision in a program we use a selection statement .
In Python we use
if elif
and
else
Let's look at some coded examples...
Slide 26 - Tekstslide
Slide 27 - Video
create.withcode.uk
Slide 28 - Link
Now Try Yourself
Slide 29 - Tekstslide
Task - If Statement with Elif
Click here for the task link - If / Elif - Create with Code
Video - click here for YouTube support video
Slide 30 - Tekstslide
In python you must write IF, ELIF and ELSE in capital letters
A
TRUE
B
FALSE
Slide 31 - Quizvraag
After every if, elif and else statement you put ...
A
;
B
}
C
:
D
#
Slide 32 - Quizvraag
An elif part of the code will only run if the if part was not met
A
True
B
False
Slide 33 - Quizvraag
an if statement must always have an else component
A
True
B
False
Slide 34 - Quizvraag
which of the following if statements would cause an error
A
if name != "Fred":
B
if password == guess:
C
if name = "Bobby":
D
if age >= 18 :
Slide 35 - Quizvraag
Slide 36 - Video
While Loops
Sometimes you need the computer to repeat steps until a certain condition has been met
In Python we use
while
and
for
Let's look at some coded examples of a while loop...
Slide 37 - Tekstslide
create.withcode.uk
Slide 38 - Link
Your Turn
Making a quiz question program
Slide 39 - Tekstslide
create.withcode.uk
Slide 40 - Link
Meer lessen zoals deze
Y8 Python
Juli 2022
- Les met
30 slides
Computing
Lower Secondary (Key Stage 3)
Python Development Lesson 1 - JM Lesson Obs
Mei 2023
- Les met
35 slides
LessonUp
Lower Secondary (Key Stage 3)
Python Lesson 5 - Recall
September 2023
- Les met
27 slides
Computing
Lower Secondary (Key Stage 3)
Y8 Python
Juni 2022
- Les met
38 slides
Computing
Lower Secondary (Key Stage 3)
Python Development Lesson 1
April 2023
- Les met
28 slides
LessonUp
Lower Secondary (Key Stage 3)
Python - Updated
April 2024
- Les met
45 slides
Computing
Lower Secondary (Key Stage 3)
Python - 2024
Juni 2024
- Les met
45 slides
Computing
Lower Secondary (Key Stage 3)
Python - Lesson 2
April 2023
- Les met
21 slides
Computing
Lower Secondary (Key Stage 3)