QuestenaPractice that shows what to review next
Question 6

Spot the false description of `type(text)` when `text` refers to an object.

  1. It returns the exact class of `text`.
  2. It tests whether `text` belongs anywhere in a class hierarchy.Correct answer
  3. Its result is a class object rather than a class-name string.
  4. Subclass-related objects can still return different exact classes.

Explanation

The call returns the object's exact class, which can then be inspected or compared. Subclass-aware membership is instead the job of `isinstance`, so treating `type` as a hierarchy test confuses two distinct operations.

Continue with this test

Start practice
Question 6: Spot the false description of `type(text)` when `text`… · Python Fundamentals · Questena