Computer Science
Assertion(A): List is an immutable data type.
Reasoning(R): When an attempt is made to update the value of an immutable variable, the old variable is destroyed and a new variable is created by the same name in memory.
- Both A and R are true, and R is the correct explanation of A.
- Both A and R are true, and R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Python List Manipulation
1 Like
Answer
Assertion is false but Reason is true.
Reason — List is a mutable data type. When an attempt is made to update the value of an immutable variable, the old variable is destroyed and a new variable with the updated value is created, and the variable name is reassigned to point to this new object in memory.
Answered By
3 Likes
Related Questions
Fill in the blank:
In case of …………… switching, before a communication starts, a dedicated path is identified between the sender and the receiver.
Which of the following functions changes the position of file pointer and returns its new position?
- flush()
- tell()
- seek()
- offset()
Assertion(A): Python Standard Library consists of various modules.
Reasoning(R): A function in a module is used to simplify the code and avoids repetition.
- Both A and R are true, and R is the correct explanation of A.
- Both A and R are true, and R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
(i) Expand the following terms: POP3, URL
(ii) Give one difference between XML and HTML.