如何用PYTHON计算出矩形的面积
1、打开JUPTER NOTEBOOK,新建一个PY文档。

3、width = input("Please input the width: ")length = input("Please input the width: ")size = width * lengthprint(size)也可以用INPUT,但是要注意这样会出现问题的。

5、width = float(input("Please input the width: "))length = float(input("Please input the width: "))size = width * lengthprint(size)如果有小数点的话那么就要用浮点型了。

7、 def size(self): return self.width * self.lengthshape = Retangle(5, 6)print(shape)可以看到这样得不到我们要的结果。

9、只要分开都会出现问题。
