What is LessonUp
Search
Channels
Log in
Register
‹
Return to search
Python lesson 2
Python programming
Lesson 2
1 / 23
next
Slide 1:
Slide
Computing
Lower Secondary (Key Stage 3)
This lesson contains
23 slides
, with
interactive quizzes
and
text slides
.
Lesson duration is:
50 min
Start lesson
Save
Share
Print lesson
Items in this lesson
Python programming
Lesson 2
Slide 1 - Slide
What are the errors in this program?
Extension: What will the outcome of this program be when fixed?
Click Here
Click here
Slide 2 - Open question
KEY OBJECTIVE
Conquer: To understand the need for variables and inputs.
Aspire: Create your own variables.
Slide 3 - Slide
Previously you have:
Written a program in a sequence
Used the print statement
Used a subroutine
Checked for errors in your code
Fixed common errors in your code
Slide 4 - Slide
PRIMM
All new programmers use the PRIMM method to learn and create new code. There are 5 key stages.
Predict
Run
Investigate
Modify
Make
Slide 5 - Slide
Task 1 - PREDICT
What do you think this code will do?
Slide 6 - Slide
What will this code do?
Make your prediction
Slide 7 - Open question
Lets check your prediction
Run the code
Click the green play button
Slide 8 - Slide
Run the following code:
What has changed about this code?
Click Here
Slide 9 - Open question
INVESTIGATE and MODIFY
Make the program call the other two functions
Change the name in the printing2 procedure to your name
(Harder)
Add more text after the greeting in printing3 so it will print the following --> "Hello Sally , nice to meet you"
CLICK ME
Slide 10 - Slide
Variables
We use variables to save information inside our programs.
This information could be your name, score, health and more.
Slide 11 - Slide
Creating variables
To create a variable we need to give it a name
We then store the information we want inside with the = Sign
Slide 12 - Slide
Create 5 variables
To store
Click here
Your name
Favorite food
Dream holiday destination
Age
Favorite Film
Slide 13 - Slide
Predict:
What will the outcome of this code be?
A
Hello world will appear
B
"Hello world" will appear
C
Nothing
D
An error will occur
Slide 14 - Quiz
Predict:
What will the outcome of this code be?
A
Error on line 4
B
Error on line 7
C
Hello there
D
Nothing
Slide 15 - Quiz
What is the process of fixing errors in your program?
A
Error checking
B
Debugging
C
Syntax errors
D
Python
Slide 16 - Quiz
What is the name of the format we have to write in python
A
Grammar
B
Debugging
C
Syntax
D
Functions
Slide 17 - Quiz
What keyword do we use to create a function?
A
def
B
Define
C
def()
D
Define function.
Slide 18 - Quiz
Inputs
Sometimes we want the user to be able to enter their own information to store
We make the variable in the same way, but this time we add the word input to allow the user to respond
Slide 19 - Slide
Lesson task
Create 4 variables with inputs that asks the following questions
Click here
What is your full name?
What was your favorite thing about the holidays?
What are you looking forward to for your options?
What can you improve on from last year?
Slide 20 - Slide
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 21 - Drag question
Which of these variable names would be most suitable to hold data on a person's surname in Python?
A
lastName
B
firstName
C
surname
D
Age
Slide 22 - Quiz
Mastery typing task
To become efficient programmers we must get better and faster at typing
Click here
Slide 23 - Slide
More lessons like this
Python lesson 3
September 2024
- Lesson with
20 slides
Computing
Lower Secondary (Key Stage 3)
Python - Updated
April 2024
- Lesson with
45 slides
Computing
Lower Secondary (Key Stage 3)
Python - 2024
June 2024
- Lesson with
45 slides
Computing
Lower Secondary (Key Stage 3)
Python lesson 3
September 2023
- Lesson with
14 slides
Computing
Lower Secondary (Key Stage 3)
Python lesson 3
March 2024
- Lesson with
14 slides
Computing
Lower Secondary (Key Stage 3)
Python Lesson 5 - Recall
September 2023
- Lesson with
27 slides
Computing
Lower Secondary (Key Stage 3)
Y8 Python - Low Ability - If Elif JM
June 2023
- Lesson with
40 slides
Computing
Lower Secondary (Key Stage 3)
Y8 Python
July 2022
- Lesson with
30 slides
Computing
Lower Secondary (Key Stage 3)