one-file-projects/ds.py

21 lines
431 B
Python
Raw Normal View History

2014-11-04 13:06:32 +01:00
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)