Question:medium

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

The Correct Option is A

Solution and Explanation

Step 1: Start from the Reason:
Python has a rule that + joins only objects of the same kind. A list joins with a list, and a string joins with a string.
Python does not mix a list with a string. So R is true.

Step 2: Apply the rule to the Assertion:
In [1,2,3]+'123' we have a list on the left and a string on the right.
This breaks the rule above. The run gives TypeError: can only concatenate list (not "str") to list.
So the expression is invalid, and A is true.

Step 3: Test the link:
Ask this: why is the expression invalid? The answer is 'because a list cannot be concatenated with a string'. This is just R.
So R is the right explanation of A.

Step 4: Pick the option:
Both true plus a correct explanation is the first option.
If we wanted a valid result we could write [1,2,3]+list('123'), which gives [1, 2, 3, '1', '2', '3'].

Final Answer:
Option (A) is correct.
Was this answer helpful?
0