← Quiz: Tuples and Sets: all 15 questions
Quiz: Tuples and Sets · Question 2 of 15
Which creates a tuple with one item?
Which creates a tuple with one item?
- A.(7)
- B.(7,)
- C.tuple(7)
- D.[7]
Answer & explanation
Correct answer: (7,)
The comma makes it a tuple. (7) is just 7, and tuple(7) is an error because 7 is not iterable.
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 →