所以,这是我的代码片段:
return "a Parallelogram with side lengths {} and {}, and interior angle
{}".format(str(self.base), str(self.side), str(self.theta))
它超出了 80 个字符的良好样式,所以我这样做了:
return "a Parallelogram with side lengths {} and {}, and interior angle\
{}".format(str(self.base), str(self.side), str(self.theta))
我添加了“\”来分解字符串,但是当我打印它时会出现这个巨大的空白。
你将如何在不扭曲代码的情况下拆分代码?
谢谢!