To concatenate, or combine, two strings you can use the + operator.
Merge variable a
with variable b
into variable c
:
a = "Hello"
b = "World"
c = a + b
print(c)
Try it Yourself »
To add a space between them, add a " "
:
a = "Hello"
b = "World"
c = a + " " + b
print(c)
Try it Yourself »
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!