回答編集履歴

3

誤字訂正

2020/01/06 09:12

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  比較するなら `if type(txt.get()) is not int:` です。
4
4
 
5
- `txt.get()).isdigit():` で数字のみか判断することもできます。
5
+ `txt.get().isdigit():` で数字のみか判断することもできます。

2

説明変更

2020/01/06 09:12

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -1,5 +1,5 @@
1
1
  `int()` は `0` を生成します。typeと数値の0と比較しても意味がありません。
2
2
 
3
- `txt.get()).isdigit():` で数字のみか判断できます。
3
+ 比較するなら `if type(txt.get()) is not int:` です。
4
4
 
5
- `int(txt.get())` で数字を数値に変換できます。
5
+ `txt.get()).isdigit():` で数字のみか判断することもできます。

1

変更

2020/01/06 09:04

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -1,4 +1,4 @@
1
- `int()` は `0` を生成します。文字列を数値の0と比較しても意味がありません。
1
+ `int()` は `0` を生成します。typeと数値の0と比較しても意味がありません。
2
2
 
3
3
  `txt.get()).isdigit():` で数字のみか判断できます。
4
4