We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc871f0 commit 214fe96Copy full SHA for 214fe96
rectangle_area.py
@@ -0,0 +1,22 @@
1
+# coding: utf-8
2
+
3
+class Rectangle:
4
5
+ '''
6
+ * Define a constructor which expects two parameters width and height here.
7
8
+ # write your code here
9
10
11
+ * Define a public method `getArea` which can calculate the area of the
12
+ * rectangle and return.
13
14
15
+ def __init__(self, width, height):
16
+ self.width = width
17
+ self.height = height
18
19
+ def getArea(self):
20
+ return self.width * self.height
21
22
+# naive: http://lintcode.com/zh-cn/problem/rectangle-area/
0 commit comments