🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.(7)
  2. B.(7,)
  3. C.tuple(7)
  4. 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 →