所以,这是我的代码片段:
return "a Parallelogram with side lengths {} and {}, and interior angle
{}".format(str(self.base), str(self.side), str(self.theta))
Run Code Online (Sandbox Code Playgroud)
它超越了80个字符,在一条线上有良好的造型,所以我这样做:
return "a Parallelogram with side lengths {} and {}, and interior angle\
{}".format(str(self.base), str(self.side), str(self.theta))
Run Code Online (Sandbox Code Playgroud)
我添加了"\"来分解字符串,但是当我打印它时会出现这个巨大的空白间隙.
如何在不扭曲代码的情况下拆分代码?
谢谢!