-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvuelo.py
38 lines (32 loc) · 943 Bytes
/
vuelo.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
35
36
37
38
class Vuelo:
def __init__(self, id = "", origen = "", destino = "", peso = 0):
self.__id = id
self.__origen = origen
self.__destino = destino
self.__peso = peso
def __str__(self):
return(
"Identificador: " + self.__id + "\n" +
"Origen: " + self.__origen + "\n" +
"Destino: " + self.__destino + "\n" +
"Peso: " + str(self.__peso) + "\n"
)
def to_dict(self):
return {
"id": self.__id,
"origen": self.__origen,
"destino": self.__destino,
"peso": self.__peso
}
@property
def id(self):
return self.__id
@property
def origen(self):
return self.__origen
@property
def destino(self):
return self.__destino
@property
def peso(self):
return self.__peso