Cover Year 9 Python Lesson 2 180923

Python programming 
Year 9 - Lesson 2
1 / 19
next
Slide 1: Slide
ComputingLower Secondary (Key Stage 3)

This lesson contains 19 slides, with interactive quizzes and text slides.

time-iconLesson duration is: 50 min

Items in this lesson

Python programming 
Year 9 - Lesson 2

Slide 1 - Slide

Question 1: What is a program?
Question 2: Correct this code.

Extension :

Slide 2 - Open question

In this lesson, you will...
Conquer: Develop your python skills, this will include displaying messages, creating and using variables and input from the keyboard.


Aspire Higher: Use variables to create an interactive story.

Slide 3 - Slide

Print recap: Use create with code to answer these 4 questions.

What is your first name?
What is your last name?
How old are you?
What school do you go to?

Slide 4 - Slide

What is the process of checking a program for errors?
A
Error checking
B
De-bugging
C
Error finding
D
Mistake finding

Slide 5 - Quiz

Which symbol is used to comment our code?
A
#
B
""
C
()
D
-

Slide 6 - Quiz

Variables recap
  • In programming, a variable is like a container that holds a piece of information. This information can be anything, like a number, a word, or even a whole sentence!


  • To use a variable, you first need to give it a name. This is like labelling the box with the word "apple" so you know what's inside. In programming, you can choose any name you want for your variable, as long as it follows certain rules. For example, the name can't have spaces in it, and it can't start with a number.



Slide 7 - Slide

Let's look at how we would declare a variable
name = "bob"

We have to give a name to the variable, in this case I have named the variable name as I am storing the name "Bob"

print (name)
I then use the print code to print the contents of my variable, I do not need speech marks when printing a saved variable. 



Slide 8 - Slide

What will be the output from these lines of code?

A
Hello Jim
B
"Hello " + name"
C
Hello name
D
An error will occur

Slide 9 - Quiz

What will be the output from these lines of code?

A
Hello Bob
B
"Hello " + name"
C
Hello name
D
An error will occur

Slide 10 - Quiz

What will be the output from these lines of code?

A
Hello name my name is myname
B
"Hello " + name" + myname
C
Hello Bob My name is John
D
An error will occur

Slide 11 - Quiz

Create your own
Create your own variables to store your favorite subject, book, film, food or sport.

Create 3 variables and print them to the screen.
1 has been done to help you


Slide 12 - Slide

Inputs 
In python we are able to allow users to enter and store information inside a variable.





Here is the code running







Slide 13 - Slide

Lets program (5 to 7 mins) 
You are going to program an extended conversation using our new knowledge of variables and inputs. 

Click the below link - extra help has been added using comments.



Slide 14 - Slide

What symbol do I use to comment code?

Slide 15 - Open question

What is a variable?
A
It allows you to enter information.
B
An error in your program
C
A comment explaining your code.
D
A container that holds information

Slide 16 - Quiz

What is the process of checking a program for errors?
A
Error checking
B
De-bugging
C
Error finding
D
Mistake finding

Slide 17 - Quiz

What type of information can be stored in a variable?
A
Only videos
B
Only sounds
C
Only pictures
D
Numbers, text, and other types of data

Slide 18 - Quiz


Slide 19 - Open question