Computer Science

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.

Python Funda

3 Likes

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.

Answered By

2 Likes


Related Questions