ExamVeda
Login
Home
Python Built In Functions
?

What is the output of the following code:
my_string = "Hello, World!"
print(my_string.upper())

Answer & Solution
Correct Answer: Option A
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!"
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.