回答編集履歴
3
ソース修正
answer
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
```python
|
5
5
|
with open('test.txt', mode='r', encoding='utf-8') as f:
|
6
6
|
score = [[s[0], int(s[1])] for s in [line.rstrip().split(' ') for line in f]]
|
7
|
-
print(score)
|
7
|
+
print(f'score = {score}')
|
8
8
|
|
9
9
|
'''
|
10
10
|
[['英語', 80], ['数学', 90], ['国語', 70], ['理科', 80], ['社会', 70]]
|
2
ソース修正
answer
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
```python
|
5
5
|
with open('test.txt', mode='r', encoding='utf-8') as f:
|
6
6
|
score = [[s[0], int(s[1])] for s in [line.rstrip().split(' ') for line in f]]
|
7
|
-
|
7
|
+
print(score)
|
8
8
|
|
9
9
|
'''
|
10
10
|
[['英語', 80], ['数学', 90], ['国語', 70], ['理科', 80], ['社会', 70]]
|
1
ソース修正
answer
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
元データはテキストから読み込むものだと思うのでそのように実装しました。
|
4
4
|
```python
|
5
5
|
with open('test.txt', mode='r', encoding='utf-8') as f:
|
6
|
-
|
6
|
+
score = [[s[0], int(s[1])] for s in [line.rstrip().split(' ') for line in f]]
|
7
|
-
print(
|
7
|
+
print(score)
|
8
8
|
|
9
9
|
'''
|
10
10
|
[['英語', 80], ['数学', 90], ['国語', 70], ['理科', 80], ['社会', 70]]
|