What will be the result of ('a', 'b') + ('c',) in Python?
-
A
('a', 'b', 'c')
Correct answer
-
B
('a', 'b', 'c', 'd')
-
C
('a', 'b', 'd', 'c')
-
D
Error
Correct answer
A. ('a', 'b', 'c')
20 views
Explanation
The + operator concatenates tuples, so ('a', 'b') + ('c',) results in ('a', 'b', 'c').
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ