回答編集履歴

1

コード修正

2018/01/10 07:53

投稿

can110
can110

スコア38252

test CHANGED
@@ -6,10 +6,16 @@
6
6
 
7
7
  import datetime
8
8
 
9
- t1 = datetime.datetime.strptime('10:00:00', '%H:%M:%S')
9
+ dt1 = datetime.datetime.strptime('10:00:00', '%H:%M:%S')
10
10
 
11
- t2 = datetime.datetime.strptime('10:00:10', '%H:%M:%S')
11
+ input_time1 = dt1.time()
12
12
 
13
+ dt2 = datetime.datetime.strptime('10:00:10', '%H:%M:%S')
14
+
15
+ input_time2 = dt2.time()
16
+
17
+
18
+
13
- print( (t2-t1).total_seconds()) # 10.0
19
+ print( (dt2-dt1).total_seconds()) # 10.0
14
20
 
15
21
  ```