1. 使用加号 `+` 运算符:
str1 = "Hello"
str2 = "World"
result = str1 + " " + str2
print(result) 输出:Hello World
2. 使用字符串的 `join()` 方法:
str1 = "Hello"
str2 = "World"
result = " ".join([str1, str2])
print(result) 输出:Hello World
3. 使用 f-string(Python 3.6+):
str1 = "Hello"
str2 = "World"
result = f"{str1} {str2}"
print(result) 输出:Hello World
以上方法都可以用来连接两个字符串。选择哪一种方法取决于你的个人偏好和具体的使用场景