Skip to content

Commit 0041bc7

Browse files
Eric ChouEric Chou
authored andcommitted
add ch15
1 parent 341fcfd commit 0041bc7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎ch15/ex15_1.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env python
2+
3+
class Point(object):
4+
"""Represents a point in 2-D space."""
5+
6+
def distance_between_points(self, x, y):
7+
d = x - y
8+
return d
9+
10+
z = Point()
11+
z.x = 10
12+
z.y = 8
13+
14+
distance = z.distance_between_points(z.x, z.y)
15+
print distance
16+

0 commit comments

Comments
 (0)