回答編集履歴
1
bsdfanさんのご指摘を反映
test
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
bsdfanさんご指摘を反映しました。
|
2
|
+
|
1
|
-
|
3
|
+
秒数が30の場合に切り上げずに切り下げられていますが、ご容赦ください。
|
2
4
|
|
3
5
|
|
4
6
|
|
@@ -14,10 +16,26 @@
|
|
14
16
|
|
15
17
|
>>> seconds = int(total_minutes.total_seconds())
|
16
18
|
|
17
|
-
>>> hm = '%d:%02d' % (seconds//3600, seconds%3600)
|
19
|
+
>>> hm = '%d:%02d' % (seconds//3600, round(seconds%3600/60))
|
18
20
|
|
19
21
|
>>> print(hm)
|
20
22
|
|
21
23
|
36:00
|
22
24
|
|
25
|
+
>>>
|
26
|
+
|
27
|
+
>>> total_minutes = datetime.timedelta(days=1, hours=12, minutes=20, seconds=31)
|
28
|
+
|
29
|
+
>>> print(total_minutes)
|
30
|
+
|
31
|
+
1 day, 12:20:31
|
32
|
+
|
33
|
+
>>> seconds = int(total_minutes.total_seconds())
|
34
|
+
|
35
|
+
>>> hm = '%d:%02d' % (seconds//3600, round(seconds%3600/60))
|
36
|
+
|
37
|
+
>>> print(hm)
|
38
|
+
|
39
|
+
36:21
|
40
|
+
|
23
41
|
```
|