回答編集履歴
2
再送
answer
CHANGED
File without changes
|
1
追記
answer
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
こんな感じでしょうか。str.isdigit を利用します。
|
1
|
+
こんな感じでしょうか。[str.isdigit](https://docs.python.jp/3/library/stdtypes.html#str.isdigit) を利用します。
|
2
2
|
```Python
|
3
3
|
def search_nums(lst):
|
4
4
|
return [
|
@@ -10,6 +10,12 @@
|
|
10
10
|
print(search_nums(xList))
|
11
11
|
```
|
12
12
|
|
13
|
+
**実行結果** [Wandbox](https://wandbox.org/permlink/K4XhLpW0npEcKSIY)
|
14
|
+
```
|
15
|
+
[3]
|
16
|
+
```
|
17
|
+
|
18
|
+
---
|
13
19
|
関数search_numsは次のように書いても良いです。
|
14
20
|
```Python
|
15
21
|
def search_nums(lst):
|