Cover Year 9 Python Lesson 2 180923

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

Cette leçon contient 19 diapositives, avec quiz interactifs et diapositives de texte.

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

Éléments de cette leçon

Python programming 
Year 9 - Lesson 2

Slide 1 - Diapositive

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

Extension :

Slide 2 - Question ouverte

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 - Diapositive

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 - Diapositive

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 - Diapositive

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 - Diapositive

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 - Diapositive

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





Here is the code running







Slide 13 - Diapositive

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 - Diapositive

What symbol do I use to comment code?

Slide 15 - Question ouverte

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 - Question ouverte