Cover Year 9 Python Lesson 2 180923

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

In deze les zitten 19 slides, met interactieve quizzen en tekstslides.

time-iconLesduur is: 50 min

Onderdelen in deze les

Python programming 
Year 9 - Lesson 2

Slide 1 - Tekstslide

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

Extension :

Slide 2 - Open vraag

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

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

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

Slide 5 - Quizvraag

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

Slide 6 - Quizvraag

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

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

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

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

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

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

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





Here is the code running







Slide 13 - Tekstslide

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

What symbol do I use to comment code?

Slide 15 - Open vraag

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

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

Slide 17 - Quizvraag

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


Slide 19 - Open vraag