1. Home
  2. Data Science
  3. Python
  4. What will be the result of ('a', 'b') + ('c',) in Python?

Added 4 May 2024

What will be the result of ('a', 'b') + ('c',) in Python?

  1. ('a', 'b', 'c') Correct answer
  2. ('a', 'b', 'c', 'd')
  3. ('a', 'b', 'd', 'c')
  4. Error

Correct answer

A. ('a', 'b', 'c')

20 views

MCQSEXAM

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

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs