Prepare for the A Level Computer Science OCR Exam with comprehensive quizzes that cover essential topics, flashcards, and detailed explanations to help you excel. Ace your exam with confidence!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What is a key characteristic of a tuple?

  1. It cannot contain duplicate elements

  2. It is an indexed collection of fields typically by name

  3. It must have a fixed length

  4. It only stores numerical data

The correct answer is: 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.