Question:

Assertion (A): [1,2,3]+'123' is an invalid expression in Python.

Reason (R): In Python, a list cannot be concatenated with a string.

Show Hint

Python raises a TypeError when a list is added to a string. So A and R are both true, and R is the cause.
Updated On: Oct 20, 2026
  • Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation for Assertion (A).
  • Both Assertion (A) and Reason (R) are true and Reason (R) is not the correct explanation for Assertion (A).
  • Assertion (A) is true, but Reason (R) is false.
  • Assertion (A) is false, but Reason (R) is true.
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Run the expression:
The expression is [1,2,3]+'123'.
The left side is a list. The right side is a string.
Python tried it and gave: TypeError: can only concatenate list (not "str") to list.
So the expression is invalid and Assertion (A) is true.

Step 2: Check the Reason (R):
The + sign joins two objects of the same sequence type, such as list + list or str + str.
Python does not join a list with a string. So Reason (R) is true.

Step 3: Does R explain A?
The expression fails exactly because a list cannot be concatenated with a string.
So R is the correct reason for A.

Step 4: Check the options:
Option (A): both true and R explains A. This matches.
Option (B): both true but R does not explain A. It is wrong, since R is the exact cause.
Option (C): says R is false, but R is true.
Option (D): says A is false, but A is true.

Final Answer:
Both A and R are true, and R explains A. This is option (A).
Was this answer helpful?
0
0