Photo AI
Last Updated Sep 26, 2025
Revision notes with simplified explanations to understand Arrays quickly and effectively.
360+ students studying
An array is a data structure used to store multiple values of the same data type in a single variable. Arrays are particularly useful when solving problems that require the storage of large amounts of related data, such as lists of names or scores.
A 1D array stores a simple list of values, accessed using an index starting from 0.
Operation | Example |
---|---|
Creating a 1D Array | names = ["Bob", "Alex", "Chris"] |
Accessing an Item | names[1] → Output: Alex (index starts at 0) |
Looping through a 1D Array | for name in names: print(name) |
Length of a 1D Array | len(names) → Output: 3 |
Summing Items in an Array | scores = [5, 12, 5, 7, 8] total = sum(scores) → Output: 37 |
A 2D array stores data in a grid, allowing access using two indices: one for the row and one for the column. It's useful for working with more complex data like tables.
Operation | Example |
---|---|
Creating a 2D Array | matrix = [[1, 2], [3, 4], [5, 6]] (3 rows and 2 columns) |
Accessing an Item | matrix[1][1] → Output: 4 (Row 1, Column 1) |
Looping through a 2D Array | for row in matrix: for col in row: print(col) |
Emulating a Table | customers = [["John", "London"], ["Jane", "Paris"]] |
Length of a 2D Array | len(matrix) → Output: 3 (number of rows) |
Enhance your understanding with flashcards, quizzes, and exams—designed to help you grasp key concepts, reinforce learning, and master any topic with confidence!
80 flashcards
Flashcards on Arrays
Revise key concepts with interactive flashcards.
Try Computer Science Flashcards8 quizzes
Quizzes on Arrays
Test your knowledge with fun and engaging quizzes.
Try Computer Science Quizzes8 questions
Exam questions on Arrays
Boost your confidence with real exam questions.
Try Computer Science Questions1 exams created
Exam Builder on Arrays
Create custom exams across topics for better practice!
Try Computer Science exam builder13 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+ GCSE students using SimpleStudy...
Join Thousands of GCSE Students Using SimpleStudy to Learn Smarter, Stay Organized, and Boost Their Grades with Confidence!
Report Improved Results
Recommend to friends
Students Supported
Questions answered