lesson 4 variables in python

10
Faculty of Business & Computing Student Shared > ICT > Year 9 > Social Networking Student Shared > Computing > Year 9 > Programming > Lesson 4 Variables Year 9 Computing

Upload: eurythmic

Post on 27-Jul-2015

218 views

Category:

Education


0 download

TRANSCRIPT

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

Variables

Year 9 Computing

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

Starter Activity

What do you remember from last week?

Open Pyscripter Portable

Write a program that will print the message “I love programming!” onto the screen

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

Lesson Objectives

To know what a variable is and how it can be used in a program

To be able to write programs using variables

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

Quick Activity

Completing the sentence – which is funniest?

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

Quick Activity: Your Turn!

Who can come up with the best excuse to fill in the blank?!

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

What does this have to do with programming?

Ever used a website, program or game where the text was personalised to you? Miss Scott has…

The programmers haven’t written separate versions for each and every name possibility - they’ve simply used variables to insert the personalised information into their program. Using a variable is like leaving a blank to be filled in, as we saw on the card game.

Amazon

PowerPoint

Wii Fit

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

Demo

Your teacher will show you a program which simulates the activity on slide 4. We will discuss the questions below.

5. How do we join variables to our sentences?

3. How do we indicate which are our sentences and which are variables?

4. How can we quickly identify variables when looking at our code?

2. How do we collect input from the user?

1. Can you spot the variable in this code? What is it called?

Teacher answers

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

Task: Your Turn!

Copy and paste the “lesson tasks” PowerPoint from today’s lesson folder to your own area. Then open it up and complete the exercises. Upload to your blog once you’re done.

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

Plenary

We will look at some of your programs and see who has managed to come up with the funniest sentences!

Earlier on (slide 6) we thought about some real-world examples of the use of variables… Can you think of any more?

Next week we will do some more exercises involving variables.

Faculty of Business & Computing

Student Shared > ICT > Year 9 > Social NetworkingStudent Shared > Computing > Year 9 > Programming > Lesson 4

Homework

Download PyScripter Portable on your home computer, if you haven’t done so already.

Put a screenshot on your blog to prove you have done this successfully.