回答編集履歴
3
Add expression
test
CHANGED
@@ -22,6 +22,16 @@
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
+
def some_calculate():
|
26
|
+
|
27
|
+
"""
|
28
|
+
|
29
|
+
ここに行いたい「計算」をコーディングして、
|
30
|
+
|
31
|
+
リスト型の計算結果を return します
|
32
|
+
|
33
|
+
"""
|
34
|
+
|
25
35
|
|
26
36
|
|
27
37
|
calculator = Calculator()
|
@@ -41,3 +51,9 @@
|
|
41
51
|
print(calculator.list_answer[4])
|
42
52
|
|
43
53
|
```
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
質問欄で述べられている`計算`は`リスト型の結果`を返すと思いますので、
|
58
|
+
|
59
|
+
`Calculator` の `list_answer` は`「リスト型の計算結果」のリスト`になります
|
2
Fix answer
test
CHANGED
@@ -12,11 +12,13 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
def calculate():
|
15
|
+
def calculate(time):
|
16
16
|
|
17
|
-
|
17
|
+
for index in range(time):
|
18
18
|
|
19
|
+
answer = some_calculate()
|
20
|
+
|
19
|
-
self.list_answer.append(answer)
|
21
|
+
self.list_answer.append(answer)
|
20
22
|
|
21
23
|
|
22
24
|
|
@@ -24,17 +26,7 @@
|
|
24
26
|
|
25
27
|
calculator = Calculator()
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
-
calculator.calculate()
|
29
|
+
calculator.calculate(5)
|
30
|
-
|
31
|
-
calculator.calculate()
|
32
|
-
|
33
|
-
calculator.calculate()
|
34
|
-
|
35
|
-
calculator.calculate()
|
36
|
-
|
37
|
-
calculator.calculate()
|
38
30
|
|
39
31
|
|
40
32
|
|
1
Fix answer
test
CHANGED
@@ -38,14 +38,14 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
-
print(calculator.answer[0])
|
41
|
+
print(calculator.list_answer[0])
|
42
42
|
|
43
|
-
print(calculator.answer[1])
|
43
|
+
print(calculator.list_answer[1])
|
44
44
|
|
45
|
-
print(calculator.answer[2])
|
45
|
+
print(calculator.list_answer[2])
|
46
46
|
|
47
|
-
print(calculator.answer[3])
|
47
|
+
print(calculator.list_answer[3])
|
48
48
|
|
49
|
-
print(calculator.answer[4])
|
49
|
+
print(calculator.list_answer[4])
|
50
50
|
|
51
51
|
```
|