2.1.16

Lists

Test yourself

Lists

Lists are a data structure quite similar to an array.

Illustrative background for ListsIllustrative background for Lists ?? "content

Lists

  • Lists store multiple elements of different data types under the same identifier.
  • There can be a variable number of elements - they never get full.
Illustrative background for Lists in pseudocodeIllustrative background for Lists in pseudocode ?? "content

Lists in pseudocode

  • A list can be declared as follows:
    • pupils = []
  • Values can be added to the end of the list as follows:
    • pupils.append("Alice")
  • Values can be accessed as follows:
    • print("The first student is " + pupils[0])

Jump to other topics

1Computational Thinking & Algorithms

2Programming

3Hardware & Software

4Data

5The Internet

6Online Safety & Security

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson