← Quiz: Tuples and Sets: all 15 questions
Quiz: Tuples and Sets · Question 15 of 15
You store a student's date of birth as (day, month, year) and it should never change. Which type fits best?
You store a student's date of birth as (day, month, year) and it should never change. Which type fits best?
- A.A list
- B.A set
- C.A dictionary
- D.A tuple
Answer & explanation
Correct answer: A tuple
A tuple is fixed and keeps order, which fits a value that should not change. A set would lose the order and drop equal numbers.
Can you get the rest right without peeking?
Take the timed Quiz: Tuples and Sets quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →