teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

d

2018/10/22 03:20

投稿

tiitoi
tiitoi

スコア21960

answer CHANGED
@@ -16,11 +16,11 @@
16
16
 
17
17
  ```
18
18
  a = 4.6
19
- print(type(a), a) # <class 'float'> 4.0
19
+ print(type(a), a) # <class 'float'> 4.6
20
20
 
21
21
  # 近い整数に丸め
22
22
  b = round(a)
23
- print(type(b), b) # <class 'int'> 4
23
+ print(type(b), b) # <class 'int'> 5
24
24
 
25
25
  # 切り捨て
26
26
  c = int(a)