CBSE Class 12 Computer Science Question 32 of 105

Python Revision Tour II — Question 11

Back to all questions
11
Question

Question 11

You have the following code segment :

String1 = "my"
String2 = "work"
print(String1 + String2)

What is the output of this code?

  1. my work
  2. work
  3. mywork
  4. my
Answer
Output
mywork

Reason — The + operator creates a new string by joining the two operand strings.