Python Tuples Quiz
- Questions: 15
- Easy
- Pass mark: 70%
A tuple keeps a few values together in a fixed order: a telescope's name and launch year, a landing site's coordinates, the stops on a mission's route. Once a tuple is made, you cannot add, remove or replace its items. This free quiz has 15 short questions on creating, reading and unpacking tuples in Python, on what you can and cannot do with them, and on the comma that makes a tuple in the first place.
What the quiz covers
- Creating tuples, reading items by position and slicing
- The comma that makes a tuple, and how tuples compare with lists
- Unpacking, with
*and in for loops - Why tuples cannot change, and how to build a new one instead
count(),index(), sorting, nested tuples anddivmod()
How it works
- 15 questions: 11 with one correct answer, 4 where you select every correct answer
- After each question you see the correct answer and a short explanation
- No time limit and no account needed
- Score 70% or more (11 of 15) to pass
Each topic has a runnable example: creating tuples, tuple unpacking, the tuple methods count() and index() and tuples vs lists. After this one, try the Python Lists Quiz or the Python Dictionaries Quiz.