Question Detail

COS 102 Python strings Objective Question

Question

What is the output of "5" + "5" in Python?
Options
A 10
B "10"
C "55"
Correct Answer
D 55
Correct Answer

Option C is the correct answer.

Detailed Explanation

When two strings are concatenated using the + operator, their contents are joined. Since '5' and '5' are strings, the result is the string '55', not the numerical sum (page 11).

Hint

Remember that these are strings, not integers, so the '+' operator performs string concatenation.

Question Info