Ace the A Level Computer Science OCR 2025 – Code Your Way to Success!

Question: 1 / 400

What is a key characteristic of a tuple?

It cannot contain duplicate elements

It is an indexed collection of fields typically by name

A tuple, commonly used in programming and data structures, is indeed characterized by being an indexed collection of fields. Tuples can hold a sequence of elements, often referred to by index positions, which allows easy access to each element. Unlike lists, tuples typically have a fixed length and structure, meaning once defined, the number of elements cannot change, but the defining characteristic is their indexing system.

This indexed nature means you can retrieve fields directly using their index, similar to lists. Tuples allow for both ordered and structured data storage, and while they can contain elements of various data types, they are particularly convenient in situations where the integrity of data types and fixed lengths are paramount, such as in returning multiple values from functions or when passing around a collection of different types of data that are closely related.

Other options might present attributes that do not comprehensively or accurately describe tuples, which is why this particular choice stands out as the key characteristic.

Get further explanation with Examzify DeepDiveBeta

It must have a fixed length

It only stores numerical data

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy