1 of 17

Lesson 10: Treasure those lists!

Year 7 - Programming essentials in Scratch: part II

2 of 17

Which loop would you use and why?

Starter activity

A programmer wants to draw a single pentagon in Scratch.

A

B

C

3 of 17

Which loop would you use and why?

Starter activity

A programmer wants to draw a single pentagon in Scratch.

B

4 of 17

Lesson 10: Treasure those lists!

Objectives

In this lesson, you will:

  • Define a list as a collection of related elements that are referred to by a single name
  • Describe the need for lists
  • Identify when lists can be used in a program
  • Use a list

4

5 of 17

Introducing lists

Activity 1

Variables can only hold one piece of data at a time.

This can be limiting when you want to hold multiple pieces of data in one convenient place.

You might want to create a shopping list program for a home assistant. You couldn’t do this with a variable because it would just overwrite the previous shopping item each time.

6 of 17

Introducing lists

Activity 1

Lists allow you to hold multiple items of data under one name.

ncce.io/shoppinglist

7 of 17

Using lists as part of a game

Activity 2

Familiarise yourself with this game by experimenting with it for five minutes.

Work out how to get to the next level either through game play or through reading the code.

8 of 17

Investigating the list

Activity 2

Use the ‘Investigate the list’ worksheet to investigate how a list has been used as part of the game.

Explorer tasks

The worksheet also contains some modify challenges for you to try.

9 of 17

Discuss your answers

Activity 2

With a partner, discuss the answers that you gave to this investigation.

10 of 17

Match the description to the correct code block

Plenary

Deletes all items in a list

Replaces an item at a specific location with another item

Deletes a single item in a specific location

Checks if the list contains a specific word

Adds an item to the end of the list

11 of 17

Match the description to the correct code block

Plenary

Deletes all items in a list

12 of 17

Match the description to the correct code block

Plenary

Adds an item to the end of the list

13 of 17

Match the description to the correct code block

Plenary

Checks if the list contains a specific word

14 of 17

Match the description to the correct code block

Plenary

Deletes a single item in a specific location

15 of 17

Match the description to the correct code block

Plenary

Replaces an item at a specific location with another item

16 of 17

Homework: Parson’s Puzzle on lists

Homework

Complete the homework questions on the sheet provided.

16

Due: Next lesson

17 of 17

Next lesson

Summary

In this lesson, you…

  • Defined a list as a collection of related elements that are referred to by a single name
  • Described the need for lists
  • Identified when lists can be used in a program
  • Used a list

Next lesson, you will…

  • Begin a short programming project that incorporates all of the programming skills covered in Unit 1 and 2

17