gpt4 book ai didi

python - 语法错误 : "unexpected character after line continuation character in python" math

转载 作者:太空狗 更新时间:2023-10-30 00:21:26 25 4
gpt4 key购买 nike

我在创建这个 Python 程序时遇到了问题,我正在创建这个程序来做数学、计算等解决方案,但我得到了语法错误:“python 中行连续字符后的意外字符”

这是我的代码

print("Length between sides: "+str((length*length)*2.6)+" \ 1.5 = "+str(((length*length)*2.6)\1.5)+" Units")

我的问题是 \1.5 我试过 \1.5 但它不起作用

使用 python 2.7.2

最佳答案

除法运算符是/,不是\

关于python - 语法错误 : "unexpected character after line continuation character in python" math,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7791913/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com