回答編集履歴

3

間違い

2021/02/20 00:13

投稿

casaganai
casaganai

スコア144

test CHANGED
@@ -1,4 +1,6 @@
1
1
  ```lang-python
2
+
3
+ # -*- coding: utf-8 -*-
2
4
 
3
5
  cool = [1, 2, 3, 4]
4
6
 

2

間違い

2021/02/20 00:13

投稿

casaganai
casaganai

スコア144

test CHANGED
@@ -1,13 +1,13 @@
1
+ ```lang-python
2
+
1
3
  cool = [1, 2, 3, 4]
2
4
 
3
5
  total = 0
4
6
 
5
- for number in cool
7
+ for d in cool:
6
8
 
7
- total = total + number
9
+ total = total + d
8
10
 
9
11
  print(total)
10
12
 
11
-
12
-
13
- では?
13
+ ```

1

for文じゃなかった

2021/02/20 00:08

投稿

casaganai
casaganai

スコア144

test CHANGED
@@ -1,9 +1,13 @@
1
+ cool = [1, 2, 3, 4]
2
+
3
+ total = 0
4
+
1
- for文じゃありませんが、次ではダメでしょうか?
5
+ for number in cool
6
+
7
+ total = total + number
8
+
9
+ print(total)
2
10
 
3
11
 
4
12
 
5
- cool = [1, 2, 3, 4]
6
-
7
-
8
-
9
- print(sum(cool))
13
+ では?