teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

修正

2019/05/29 04:11

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

4

修正

2019/05/29 04:11

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

3

修正

2019/05/29 04:11

投稿

退会済みユーザー
title CHANGED
@@ -1,1 +1,1 @@
1
- Python 二次配列エクササイズ 助けて (英語のエクササイズです)
1
+ Python 二次配列
body CHANGED
@@ -1,16 +1,13 @@
1
1
  ### 前提・実現したいこと
2
- Pythonのエクササイズについて(初心者)
2
+ Pythonについて
3
3
  進め方を教えてください。
4
4
 
5
5
  ### 該当のソースコード
6
6
  Python
7
7
  以下、エクササイズ
8
8
 
9
- Read two matrices from a file named 'matrix.txt'.
9
+ Read two matrices from a file named 'd.txt'.
10
- File will be formatted like this,
10
+
11
- First line will hold row number r1 and column number c1 of first matrix. Then r1 number of line. Each line will hold c1 number of element. After that second matrix will be organized similarly.
12
- Determine the multiplication of two matrices. Use 2D list to store matrix.
13
- Output the resultant matrix. If multiplication is not possible, output 'invalid matrix combination'.
14
11
  Sample input :
15
12
  2 2
16
13
  1 2
@@ -32,12 +29,4 @@
32
29
 
33
30
  print(a)
34
31
 
35
- m1Row= a[0][0]
36
- m1Column= a[0][1]
37
- for m1 in m1Row:
38
- ```
32
+ ```
39
- ここら辺からわけわからなくなってます。調べてもよくわからず、限界です。
40
-
41
-
42
- ### 補足情報(FW/ツールのバージョンなど)
43
- ATOM使用

2

修正

2019/05/29 04:09

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -25,6 +25,7 @@
25
25
 
26
26
  ###やったこと
27
27
  ```Python
28
+ a= []
28
29
  with open('matrix.txt','r')as f:
29
30
  for line in f:
30
31
  a.append(list(map(int, line.split())))

1

修正

2019/05/29 03:13

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -24,6 +24,7 @@
24
24
 
25
25
 
26
26
  ###やったこと
27
+ ```Python
27
28
  with open('matrix.txt','r')as f:
28
29
  for line in f:
29
30
  a.append(list(map(int, line.split())))
@@ -33,6 +34,7 @@
33
34
  m1Row= a[0][0]
34
35
  m1Column= a[0][1]
35
36
  for m1 in m1Row:
37
+ ```
36
38
  ここら辺からわけわからなくなってます。調べてもよくわからず、限界です。
37
39
 
38
40