Skip to content

Commit 1d63cfe

Browse files
committed
add another example
1 parent 89ecbf7 commit 1d63cfe

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Box(object):
2+
def __init__(self, width, height):
3+
self.width = width
4+
self.height = height
5+
6+
def area(self):
7+
return self.width * self.height
8+
9+
10+
boxes = []
11+
for n in range(1, 10):
12+
boxes.append(Box(2*n, 4*n))
13+
14+
15+
for b in boxes:
16+
print(b.area())
17+

0 commit comments

Comments
 (0)