?
What is the output of print("Hello, " + "world!")?
Answer & Solution
Correct Answer:
Option
A
The output of print("Hello, " + "world!") is Hello, world!.
The print() function in Python is used to output text to the console. In this case, the function prints the concatenated string "Hello, " followed by "world!" resulting in "Hello, world!" being displayed on the console. The plus (+) operator is used for string concatenation, which combines the two strings into a single string. Therefore, the correct output is "Hello, world!".
The print() function in Python is used to output text to the console. In this case, the function prints the concatenated string "Hello, " followed by "world!" resulting in "Hello, world!" being displayed on the console. The plus (+) operator is used for string concatenation, which combines the two strings into a single string. Therefore, the correct output is "Hello, world!".
Join the Discussion
Login to post a comment or share your explanation.
Login