This lesson contains 19 slides, with interactive quizzes, text slides and 1 video.
Lesson duration is: 50 min
Items in this lesson
Python
Year 7 - Lesson 1
Slide 1 - Slide
I am an alien from out of space and I have just landed on earth! I have been told to put some clothes on! Can you create some instructions for 'Getting Dressed'?
Slide 2 - Open question
Where might we find instructions?
Slide 3 - Slide
KO: Learn to code in a text based language (Python).
All
Deploy the "print" function in Python and debug code
Most
Describe what a variable is and how they are used in computing
Some
Understand the different types of data that can be stored in a variable
Copy the below code, then click 'RUN' in the bottom right corner.
Slide 6 - Slide
Python Programming
The first program, that any programmer produces, when learning how to code, is the "Hello World!" program.
It is a simple program, that displays text to the screen.
Slide 7 - Slide
What is Syntax?
The way we write a line of code is important, as the computer needs to recognise it.
Think about our 'English'. It is important that we use correct punctuation, such as Commas and Full Stops. If we didn't, it would make our writing difficult to read.
If we do not use the correct symbols and spellings in our Python coding, then the computer will not be-able to run our programs.
Slide 8 - Slide
Task 2 - Debugging
In this task, you will need to debug the code using the error messages that create with code provide.
We are now going to create a variable and then save some data to it. We will then output "print" this data to the screen.
Press the green play button to execute the code.
Slide 13 - Slide
Variables
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!
For example, imagine you have a box that can hold a piece of fruit. You can put an apple in the box, and then later on, you can take the apple out and look at it. In programming, a variable is like that box. You can put information into the variable, and then you can use that information later on in your program.
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 14 - Slide
Task 4 : Create an adventure using inputs, outputs and variables to create a story!
Can you create a story like the one below - feel free to change the questions!
Slide 15 - Slide
Commenting our code. What is the importance?
By commenting our code, it tells you (the programmer) and anyone else who looks at the code what it does.
By using the '#' symbol, it will not display when your code has been run.
Below is an example
Slide 16 - Slide
What symbol do I use to comment code?
Slide 17 - Open question
What is the process of checking a program for errors?
A
Error checking
B
De-bugging
C
Error finding
D
Mistake finding
Slide 18 - Quiz
What type of information can be stored in a variable?