21 lines
431 B
Python
21 lines
431 B
Python
|
class Time:
|
||
|
def __init__(self, hour, minute):
|
||
|
self.hour = hour
|
||
|
self.minute = minute
|
||
|
|
||
|
def addminutes(self,dminutes):
|
||
|
self.minute += dminutes
|
||
|
self.hour += int(self.minute / 60)
|
||
|
self.minute = self.minute % 60
|
||
|
|
||
|
def __str__(self):
|
||
|
return "%02d:%02d" % (self.hour,self.minute)
|
||
|
|
||
|
|
||
|
t = Time(7,30)
|
||
|
|
||
|
for i in range(8):
|
||
|
print("%d.DS: %s" % (i+1,str(t)))
|
||
|
t.addminutes(90+20)
|
||
|
|