小编Sri*_*P S的帖子

给定python代码的print语句的语法错误是什么原因

xString = input("Enter a number: ")
x = int(xString)
yString = input("Enter a second number: ")
y = int(yString)
print('The sum of ', x, ' and ', y, ' is ', x+y, '.', sep='')
Run Code Online (Sandbox Code Playgroud)

在执行上面的代码时,解释器抛出语法错误,说法语错误如下.

 print(?The sum of ?, x, ? and ?, y, ? is ?, sum, ?.?, sep=??)
Run Code Online (Sandbox Code Playgroud)

SyntaxError:语法无效

python printing concatenation syntax-error

-5
推荐指数
1
解决办法
95
查看次数

标签 统计

concatenation ×1

printing ×1

python ×1

syntax-error ×1