-
Notifications
You must be signed in to change notification settings - Fork 0
/
city.py
35 lines (27 loc) · 863 Bytes
/
city.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class City(object):
"""Class to represent a city object
Attributes:
name(str): Name of the city.
iscode(str): The country ISO alpha-2 code
latitude(float): Latitude in degrees
longitude(float): Longitude in degrees
cloud(int): Cloud cover percentage. Will default to zero if not specified.
"""
def __init__(self, name, isocode, lat, lon, cloud=0):
"""City init method
"""
self.name = name
self.isocode = isocode
self.lat = lat
self.lon = lon
self.cloud = cloud
def get_name(self):
return self.name
def get_isocode(self):
return self.isocode
def get_lat(self):
return self.lat
def get_lon(self):
return self.lon
def get_cloudcover(self):
return self.cloud