Skip to content

Commit 24f7cd5

Browse files
committed
time fix
1 parent 80be927 commit 24f7cd5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

C04/C04_p4.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ def __add__(self,time2):
1414
second =self.__s + time2.__s
1515

1616
if minute >=60:
17-
hour =hour+1
18-
minute=minute-60
17+
q=int(minute/60)
18+
r=minute%60
19+
hour =hour+q
20+
minute=r
21+
second= self.__s + time2.__s
1922
if second >=60:
20-
minute =minute +1
21-
second =second-60
23+
q1=int(second/60)
24+
r1=second%60
25+
minute =minute +q1
26+
second =r1
2227
#return second,minute,hour
2328
print("sum of Hours:",hour)
2429
print("sum of minute:",minute)

0 commit comments

Comments
 (0)