Question Detail
Question
To correctly combine the string "Age: " with the integer 20, which of the following Python expressions should be used?
Correct Answer
Option C is the correct answer.
Detailed Explanation
Page 10, under 'The Fix', provides the solution: 'Convert the number to a string first using str().' So,
"Age: " + str(20) is the correct approach.
Hint
Remember that both operands of the '+' operator must be of the same type for string concatenation. How do you convert an integer to a string?