Answer and explanation

Correct answer: C. `<class 'tuple'>`

  1. Step 1: In Python, parentheses with a single element followed by a trailing comma define a single-element tuple.
  2. Step 2: Without the comma, `(42)` is treated as a parenthesized integer, but with the comma `(42,)`, it is a tuple.
Answer
`<class 'tuple'>`.
Why not the others: '`<class 'int'>`' is the type of `(42)` without the trailing comma; '`<class 'list'>`' uses square brackets `[42]`; '`<class 'set'>`' uses curly braces `{42}`.

Practise more Python Programming, Data Structures, Algorithms, Networks and Cybersecurity.

Free questions with an explanation for every one, and full timed Saudi Secondary School Certificate mock tests.