QuestenaUn entraînement qui indique quoi revoir ensuite
Question 2

A program runs `count = 3` and then `count = "three"`. Which description is accurate?

  1. The second statement raises TypeError because the type changed.
  2. The name ends up referring to a string object.Bonne réponse
  3. The integer object is converted in place into text.
  4. The second statement is ignored because `count` already exists.

Explication

The later assignment rebinds `count` from an integer object to a string object. Nothing converts the integer into text, and Python does not require a later binding to preserve the earlier object's type.

Continuer avec ce test

Commencer l’entraînement
Question 2: A program runs `count = 3` and then `count = "three"`.… · Python Fundamentals · Questena