質問編集履歴

1

質問の詳細を追加

2018/02/18 00:57

投稿

super_tomato
super_tomato

スコア34

test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,33 @@
1
1
  pythonでリストや配列に変数を格納することは可能でしょうか?
2
2
 
3
3
  できるのでしたらどのようにすればできるか教えていただけると助かります。
4
+
5
+ 対応に遅れて申し訳ありません。
6
+
7
+ どのような用途で使用したいかというと、for文で毎ループごとに違う変数を使用したいのです。
8
+
9
+ 例を示しますと
10
+
11
+ ```python
12
+
13
+ import matplotlib.pyplot as plt
14
+
15
+ list = []
16
+
17
+ for i in range(3):
18
+
19
+ a = plt.figure()
20
+
21
+ list[i] = a
22
+
23
+ for i in range(3)
24
+
25
+ b = list[i].add_subplot(1,1,1)
26
+
27
+ b.plot(hoge,hoge)
28
+
29
+ list[i].show()
30
+
31
+ ```
32
+
33
+ 上記のようなことをしたいのです。もしかしたらほかにいい方法があるのかもしれませんが。