Apr-12-2020, 08:38 AM
Why python allows to change the type of a variable during program execution.
Example:
sample_var = "test"; (type->string)
sample_var = 1; (type->integer)
sample_var = []; (type->list)
Why can the same variable store different types of data?
The first assignment should determine the type of the variable!
Example:
sample_var = "test"; (type->string)
sample_var = 1; (type->integer)
sample_var = []; (type->list)
Why can the same variable store different types of data?
The first assignment should determine the type of the variable!