小编Bla*_*ank的帖子

打印包含字符串和其他2个变量的变量

var_a = 8
var_b = 3

var_c = "hello my name is:",var_a,"and",var_b,"bye"
print(var_c)
Run Code Online (Sandbox Code Playgroud)

当我运行程序时,var_c被打印出来像这样:('你好我的名字是:',8,'和',3,'再见')但是所有的括号等也被打印出来,为什么这样,有没有摆脱那些符号的方法?

如果我像这样运行程序:

print("hello my name is:",var_a,"and",var_b,"bye")
Run Code Online (Sandbox Code Playgroud)

我没有那个问题

python string variables python-3.x

9
推荐指数
4
解决办法
8585
查看次数

标签 统计

python ×1

python-3.x ×1

string ×1

variables ×1