Introducing loops - For
Introducing loops - While
Set your Learning Objectives to red.
We are going to save all of our work for this topic into this PowerPoint.
Save your PowerPoint as 'Programming 1'
In computer science, a List is a programming structure that allows you to store data together in one place. We are going to look at a simple List that stores the days of the week.
Let's try it first in Edublocks.
Wouldn't it be good if we could print out all of the items in our list in one go?
We can do that by using a simple loop. Copy the code below and run it to make sure it works:
if you use month.index("March") it will tell you the index number of 'March'.
In your Powerpoint put a screenshot of your code.
One of the many things we can do with a list, when our program is running, is add and remove items from our list
The code below shows you how to both add an item and remove an item from a list. Copy the code and complete the tasks:
Copy the code and complete the tasks:
Notice how we use the index value to access the value in our list
Lets look at the learning outcomes and decide which one best describes our current level of understanding :
Tick the one you feel is closest to your level