-
Notifications
You must be signed in to change notification settings - Fork 0
/
ves.py
executable file
·35 lines (25 loc) · 895 Bytes
/
ves.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
class Veslac:
def __init__(self, oib, ime, grod, vr = 0):
if len(str(oib)) != 11:
raise TypeError("OIB must be length of 11")
self.oib = oib
self.ime = ime
self.grod = grod
self.vr = round(vr, 2)
def __str__(self):
return f"{self.ime}, {self.oib}, rođen {self.grod} i vrijeme {self.vr}"
def promijenivrijeme(self, vrijeme):
if vrijeme < self.vr:
self.vr = round(vrijeme, 2)
def __lt__ (self, other):
return self.vr < other.vr
def __gt__ (self, other):
return self.vr > other.vr
def __le__ (self, other):
return self.vr <= other.vr
def __ge__ (self, other):
return self.vr >= other.vr
def __eq__ (self, other):
return self.vr == other.vr
def __ne__ (self, other):
return self.vr!= other.vr