Python - String Concatenation
String Concatenation
To concatenate, or combine, two strings you can use the + operator.
ExampleGet your own Python Server
Merge variable a
with variable
b
into variable c
:
a = "Hello"
b = "World"
c = a + b
print(c)
Try it Yourself »
Example
To add a space between them, add a " "
:
a = "Hello"
b = "World"
c = a + " " + b
print(c)
Try it Yourself »
Exercise?What is this?
Test your skills by answering a few questions about the topics of this page
What is a correct syntax to merge variable x
and y
into variable z
?