Photo AI
Last Updated Sep 27, 2025
Revision notes with simplified explanations to understand Arrays quickly and effectively.
242+ students studying
An array is a data structure that stores a collection of elements, typically of the same data type, in a contiguous block of memory. Arrays are used to efficiently store and access multiple values using a single variable name and an index. You need to know arrays up to 3 dimensions, as they are commonly used for organising data.
A single row of elements.
Example: A list of student grades.
grades = [85, 90, 78, 92]
Consists of rows and columns, like a table or grid.
Example: A matrix representing a chessboard.
chessboard = [
[1, 0, 0, 1], # Row 1
[0, 1, 1, 0], # Row 2
[1, 1, 0, 0], # Row 3
[0, 0, 1, 1] # Row 4
]
Represents data in three dimensions, such as multiple layers of 2D grids.
Example: A 3D array for storing temperature values over time for different locations.
temperature = [
[[15, 16], [20, 21]], # Day 1: Locations 1, 2
[[18, 19], [22, 23]] # Day 2: Locations 1, 2
]
Example 1: One-Dimensional Array Store and print the names of 3 students.
students = ["Alice", "Bob", "Charlie"]
print(students[1]) # Output: Bob
Example 2: Two-Dimensional Array Store and access a table of marks for 3 students in 2 subjects.
marks = [
[85, 90], # Student 1: Subject 1, Subject 2
[78, 88], # Student 2: Subject 1, Subject 2
[92, 95] # Student 3: Subject 1, Subject 2
]
print(marks[2][1]) # Output: 95 (Student 3, Subject 2)
Example 3: Three-Dimensional Array Store and access daily temperature data for 2 cities over 2 days.
temperature = [
[[15, 16], [18, 19]], # Day 1: City 1, City 2
[[20, 21], [22, 23]] # Day 2: City 1, City 2
]
print(temperature[1][0][1]) # Output: 21 (Day 2, City 1, second time point)
Example: Using arr[1] instead of arr[1][2] for a 2D array.
:::
Enhance your understanding with flashcards, quizzes, and exams—designed to help you grasp key concepts, reinforce learning, and master any topic with confidence!
90 flashcards
Flashcards on Arrays
Revise key concepts with interactive flashcards.
Try Computer Science Flashcards9 quizzes
Quizzes on Arrays
Test your knowledge with fun and engaging quizzes.
Try Computer Science Quizzes29 questions
Exam questions on Arrays
Boost your confidence with real exam questions.
Try Computer Science Questions27 exams created
Exam Builder on Arrays
Create custom exams across topics for better practice!
Try Computer Science exam builder12 papers
Past Papers on Arrays
Practice past papers to reinforce exam experience.
Try Computer Science Past PapersDiscover More Revision Notes Related to Arrays to Deepen Your Understanding and Improve Your Mastery
Join 500,000+ A-Level students using SimpleStudy...
Join Thousands of A-Level Students Using SimpleStudy to Learn Smarter, Stay Organized, and Boost Their Grades with Confidence!
Report Improved Results
Recommend to friends
Students Supported
Questions answered