English

Assertion (A): The expression (1, 2, 3, 4).append(5) in Python will modify the original sequence datatype. Reason (R): The append() method adds an element - Computer Science (Python)

Advertisements
Advertisements

Question

Assertion (A): The expression (1, 2, 3, 4).append(5) in Python will modify the original sequence datatype.

Reason (R): The append() method adds an element to the end of a list and modifies the list in place.

Options

  • Both A and R are True and R is the correct explanation for A.

  • Both A and R are True and R is not the correct explanation for A.

  • A is True but R is False.

  • A is False but R is True.

MCQ
Assertion and Reasoning
Advertisements

Solution

A is False but R is True.

Explanation:

  • Assertion is false because tuples are immutable and do not have an append() method.
  • Reason is true but it applies only to lists, not tuples.
shaalaa.com
  Is there an error in this question or solution?
2025-2026 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×