Skip to content

Commit 2133264

Browse files
committed
aggregate2
1 parent 0694498 commit 2133264

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

app/coordinates.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
"""app.coordinates.py"""
22

3+
class Coordinates:
4+
def __init__(self, lat_long):
5+
self.lat_long = lat_long
36

4-
class Coordinates:
5-
"""
6-
A position on earth using decimal coordinates (latitude and longitude).
7-
"""
7+
if __name__ == "__main__":
8+
us_lat, us_long = 45, 60
9+
us = Point(us_lat, us_long)
10+
us_coord = Coorinates(us)
811

9-
def __init__(self, latitude, longitude):
10-
self.latitude = latitude
11-
self.longitude = longitude
1212

13-
def serialize(self):
14-
"""
15-
Serializes the coordinates into a dict.
16-
:returns: The serialized coordinates.
17-
:rtype: dict
18-
"""
19-
return {"latitude": self.latitude, "longitude": self.longitude}
2013

21-
def __str__(self):
22-
return "lat: %s, long: %s" % (self.latitude, self.longitude)
23-
© 2021 GitHub, Inc.
14+
class Point:
15+
16+
def __init__(self, x, y):
17+
self.x = x
18+
self.y = y

0 commit comments

Comments
 (0)