Computer Science

You have the following code segment :

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

What is the output of this code?

  1. mywork
  2. MY Work
  3. myWORK
  4. My Work

Python String Manipulation

1 Like

Answer

Output
myWORK

Reason — string.upper() method returns a copy of the string converted to uppercase. The + operator creates a new string by joining the two operand strings.

Answered By

2 Likes


Related Questions