Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Arrays and Records

1D arrays

All topicsPractise exam questions
Knowledge organiser

Arrays and Records

301.17a

Indexed list of values.

What you need to know

A 1D array (list in Python) stores multiple values in a single variable, accessed by index (e.g. scores[0]). Indices start at 0.

Key points

  • Create: scores = [85, 90, 72]
  • Access: scores[0] is 85 (first item)
  • Modify: scores[1] = 95
  • len(scores) gives the count of elements
  • Loop using index: for i in range(len(scores))

Code examples

1D array basics
python
scores = [85, 90, 72]
print(scores[0])     # 85
scores[1] = 95
for i in range(len(scores)):
    print(scores[i])