Python Programming - Operators - Discussion

Discussion Forum : Operators - General Questions (Q.No. 17)
17.
What is the output of the following code snippet?
x = "Hello"
y = "World"
z = x + y
print(z)
Hello World
HelloWorld
Hello + World
Error
Answer: Option
Explanation:
The + operator is used to concatenate two strings, which combines the characters of the two strings into a single string.
Discussion:
1 comments Page 1 of 1.

Rishabh Kedia said:   12 months ago
I think the answer should be, as there is no space in any of the strings, so there would be none in resultant 'z' as well.
(2)

Post your comments here:

Your comments will be displayed after verification.