QuestenaPractice that shows what to review next
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.Correct answer
  3. The integer object is converted in place into text.
  4. The second statement is ignored because `count` already exists.

Explanation

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.

Continue with this test

Start practice
Question 2: A program runs `count = 3` and then `count = "three"`.… · Python Fundamentals · Questena