回答編集履歴
2
修正
test
CHANGED
@@ -12,15 +12,21 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
+
## 修正後のコード
|
16
|
+
|
17
|
+
|
18
|
+
|
15
19
|
```python
|
16
20
|
|
17
21
|
def abbrevName(name):
|
18
22
|
|
19
|
-
|
23
|
+
list=[a for a in name]
|
20
24
|
|
21
|
-
|
25
|
+
list_2=[b for b in filter(lambda n: n.isupper(), list)]
|
22
26
|
|
27
|
+
print(list_2)
|
23
28
|
|
29
|
+
return "{}.{}".format(list_2[0],list_2[1])
|
24
30
|
|
25
31
|
|
26
32
|
|
1
修正
test
CHANGED
@@ -9,3 +9,21 @@
|
|
9
9
|
+ n.isupper()
|
10
10
|
|
11
11
|
```
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
```python
|
16
|
+
|
17
|
+
def abbrevName(name):
|
18
|
+
|
19
|
+
a, b = list(filter(lambda n: n.isupper(), name))
|
20
|
+
|
21
|
+
return f"{a}.{b}"
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
abbrevName("Sam Smith")
|
28
|
+
|
29
|
+
```
|