File tree Expand file tree Collapse file tree 1 file changed +12
-17
lines changed
Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments