QuestenaÜben und erkennen, was als Nächstes dran ist
Frage 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.Richtige Antwort
  3. Its result is a class object rather than a class-name string.
  4. Subclass-related objects can still return different exact classes.

Erklärung

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.

Mit diesem Test weitermachen

Übung starten
Frage 6: Spot the false description of `type(text)` when `text`… · Python Fundamentals · Questena