Arrays, Tuples and Records A Level Resources

A Level Computer Science: Arrays, Tuples and Records

Do you want to save hours of lesson preparation time? Get your evenings and weekends back and focus your time where it's needed! Be fully prepared with presentations, notes, activities, and more.

All Computer Science topics are covered, and each module comes complete with:

Classroom Presentations
Revision Notes
Activities & Quizzes
Mind Maps, Flashcards & Glossaries

Frequently Asked Questions

What's the main difference between an array and a tuple?

The big difference is that you can change the items in an array but you can't in a tuple. Also, all items in an array have to be of the same type, like all numbers or all text. In a tuple, you can mix different types of items, like numbers and text.

Why should I use a record instead of an array or tuple?

Records are good for organizing different kinds of information under one name. For example, you can use a record to store a student's name, age, and grades together. This makes your code easier to read and manage.

How can I get to the items in an array or tuple if I'm using Python?

You can use the item's position number to get to it. The counting starts from 0. So, in an array like [1, 2, 3], the number 1 is at position 0, and the number 2 is at position 1. It works the same way for tuples.

Are tuples really set in stone in Python? What does that mean?

Yes, once you make a tuple in Python, you can't change it. This is called being "immutable." But remember, if you have something like a list inside a tuple, you can still change the items in that list.

How do different programming languages make records?

Different languages do it in their own ways. In Python, you can use things like dictionaries or special classes. In languages like C or C++, you'd use something called a "struct." Java and C# use classes, and some newer languages have special ways to make it even easier.