小册名称:Python合辑4-130个字符串操作示例
如何连接两个变量,一个是字符串,另一个是 Python 中的 int
int1 = 10str1 = 'test'print(str(int1) + str1)
int1 = 10
str1 = 'test'
print(str(int1) + str1)
Output:
10test