CBSE Class 11 Computer Science Question 17 of 42

Practice Paper — Question 17

Back to all questions
17
Question

Question 17

Assertion (A): In Python, a variable can hold values of different types at different times.

Reason (R): Once assigned, a variable's data type remains fixed throughout the program.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.
Answer

A is true but R is false.

Explanation
In Python, variables are dynamically typed, so they can hold values of different types at different times. This means that a variable's data type is not fixed once assigned, and Python allows changing the type of a variable during the program's execution.