From ed5a61fe199e0c4b7369dd78281052ce08f28c73 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 13 Jul 2019 22:17:17 -0500 Subject: [PATCH] fix clock --- python/clock/clock.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/clock/clock.py b/python/clock/clock.py index 4eebf48..ee5443f 100644 --- a/python/clock/clock.py +++ b/python/clock/clock.py @@ -1,9 +1,10 @@ class Clock(object): def __init__(self, hour, minute): self.hour, self.minute = hour, minute + self.change(0) def __repr__(self): - return ''.format(str(self.hour).zfill(2), str(self.minute).zfill(2)) + return '{}:{}'.format(str(self.hour).zfill(2), str(self.minute).zfill(2)) def __eq__(self, other): return self.hour == other.hour and self.minute == other.minute @@ -18,6 +19,7 @@ class Clock(object): self.hour -= 1 self.minute += 60 self.hour = self.hour % 24 + return self.__repr__() def __add__(self, minutes): return self.change(minutes)