質問編集履歴
5
修正
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
4
修正
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
3
修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Python 二次配列
|
1
|
+
Python 二次配列
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
Python
|
3
|
+
Pythonについて
|
4
4
|
|
5
5
|
進め方を教えてください。
|
6
6
|
|
@@ -14,15 +14,9 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
Read two matrices from a file named '
|
17
|
+
Read two matrices from a file named 'd.txt'.
|
18
18
|
|
19
|
-
File will be formatted like this,
|
20
19
|
|
21
|
-
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.
|
22
|
-
|
23
|
-
Determine the multiplication of two matrices. Use 2D list to store matrix.
|
24
|
-
|
25
|
-
Output the resultant matrix. If multiplication is not possible, output 'invalid matrix combination'.
|
26
20
|
|
27
21
|
Sample input :
|
28
22
|
|
@@ -66,20 +60,4 @@
|
|
66
60
|
|
67
61
|
|
68
62
|
|
69
|
-
m1Row= a[0][0]
|
70
|
-
|
71
|
-
m1Column= a[0][1]
|
72
|
-
|
73
|
-
for m1 in m1Row:
|
74
|
-
|
75
63
|
```
|
76
|
-
|
77
|
-
ここら辺からわけわからなくなってます。調べてもよくわからず、限界です。
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
### 補足情報(FW/ツールのバージョンなど)
|
84
|
-
|
85
|
-
ATOM使用
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -52,6 +52,8 @@
|
|
52
52
|
|
53
53
|
```Python
|
54
54
|
|
55
|
+
a= []
|
56
|
+
|
55
57
|
with open('matrix.txt','r')as f:
|
56
58
|
|
57
59
|
for line in f:
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,6 +50,8 @@
|
|
50
50
|
|
51
51
|
###やったこと
|
52
52
|
|
53
|
+
```Python
|
54
|
+
|
53
55
|
with open('matrix.txt','r')as f:
|
54
56
|
|
55
57
|
for line in f:
|
@@ -68,6 +70,8 @@
|
|
68
70
|
|
69
71
|
for m1 in m1Row:
|
70
72
|
|
73
|
+
```
|
74
|
+
|
71
75
|
ここら辺からわけわからなくなってます。調べてもよくわからず、限界です。
|
72
76
|
|
73
77
|
|