Examveda

What is the output of print("Hello, " + "world!")?

A. Hello, world!

B. Hello world!

C. Hello + world!

D. Error

Answer: Option A

Solution (By Examveda Team)

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!".

This Question Belongs to Python Program >> Introduction To Python

Join The Discussion

Related Questions on Introduction to Python