Computing
Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

Lesson Video

20

Lesson Tasks

  • Watch the Lesson video
    Make notes if needed.
  • Open your Learning Journal
    Complete Task 1 in your Learning Journal
  • Complete the learning activities
    Make sure you complete the book tasks in your Unit Booklet
  • Complete End of Task Assessment
    Update your learning objectives

What do I need to Learn?

0 results forGuest
I need to learn how to understand and use a one dimensional array as a data structure.

Key Terms

Data structure Array List Variable Identifier

Task 1 - Getting organised Click to see more


Task: Learning Journal

Open your Learning Journal by clicking on the image below

Good notes will help you organise and process data and information

Task 1: Fill out your learning Journal.

Open your Learning Journal and complete the task below .


Task 2 - Using Data Structures Click to see more

Data Structures

In computer science, a data structure is a way of organizing and storing data in a computer so that it can be accessed and modified efficiently. Some common data structures include arrays, linked lists, stacks, queues, trees, and graphs. Each data structure has its own advantages and disadvantages and is suited for specific types of problems. The choice of a data structure is often determined by the specific requirements of a problem or application.

A list is a built-in data structure in Python that stores a collection of items. Here's an example of how you can create a list of names in Python:

names = ["Alice", "Bob", "Charlie", "David"]

You can access the items in the list by their index, which is the position of the item in the list. For example, you can access the first name in the list like this:

print(names[0]) # Output: "Alice"

You can also modify the items in the list by assigning a new value to a specific index. For example, you can change the first name in the list like this:

names[0] = "Ava" print(names) # Output: ["Ava", "Bob", "Charlie", "David"]

Task: Answer the questions below in your PowerPoint.

Create the list below in python:

a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

  1. Write a program that prints out all the elements of the list that are less than 5
  2. Write a program that finds the biggest number in the list and prints it out

  • When you are finished screenshot your code into your Learning Journal


  • Task 3 - Changing Data Structures Click to see more

    You can add new items to a list using the append() method. Here's an example of how you can add a new name to the list:

    names.append("Ava") print(names) # Output: ["Ava", "Bob", "Charlie", "David","Eve"]

    You can also add new items to a list using the insert() method this is a built-in method in Python that allows you to insert an item at a specific position in a list. The method takes two arguments: the index at which to insert the item and the item to be inserted. Here's an example of how you can use the insert() method on the list of names:

    names = ["Alice", "Bob", "Charlie", "David"] # Insert the name "Eve" at index 2 names.insert(2, "Eve") print(names) # Output: ["Alice", "Bob", "Eve", "Charlie", "David"]

    You can also remove items from a list using the remove() method or delete an item at a specific position using the del statement. Here's an example of how you can remove a name from the list:

    names.remove("Bob") print(names) # Output: ["Ava", "Charlie", "David", "Eve"]

    Task: Answer the questions below in your PowerPoint.

    Create the list below in python:

    fruits_list = ["apple", "grape", "strawberry"]

    1. Write a program that adds the elements "orange" and "banana" to the end of the list of fruits called "fruits_list and prints out the new list
    2. Add a line of code to your program that inserts the element "mango" at the third position of a list of fruits called "fruits_list" and prints out the new list
    3. Add a line of code to your program that removes the element "apple" from a list of fruits called "fruits_list" and prints out the new list

    Your final printed out list should look like this

    fruits_list = ["grape", "strawberry", "mango", "orange", "banana"]


  • When you are finished screenshot your code into your Learning Journal


  • Task 4 - Book Tasks Click to see more

    Task: Data Structures

    Open your student workbook at page 47 Read through the notes and complete the following tasks.
    1. Task 25
    2. Task 26
    3. Task 27


    Task 5 - End of Task Assessment Click to see more