Q10
What is the output of the following code:my_string = "Hello, World!"print(my_string.upper())
A.
"HELLO, WORLD!"
AnswerB.
"hello, world!"
C.
"Hello, World!"
D.
"hello"
Answer: Option A
Solution
Answer: Option A
Solution:
The correct answer is Option A: "HELLO, WORLD!".The upper() method in Python is used to convert all the characters in a string to uppercase.
So, when you call upper() on the string "Hello, World!", it converts all the letters to uppercase.
my_string = "Hello, World!"
print(my_string.upper()) # Output: "HELLO, WORLD!"