请教一个小程序里的一个问题

请教一个小程序里的一个问题

from random import shuffle

arrayB=[[1156,1470,1154,1422,1152,1418,1150,1414,1148,1410,1146,1406,1144,1402,1142,1398,1139,1394,1136,1137],
[1471,1473,1469,1423,1421,1420,1417,1416,1413,1412,1409,1408,1405,1404,1401,1400,1397,1396,1393,1135],
[1155,1472,1440,1439,1378,1419,1377,1415,1375,1411,1373,1407,1371,1403,1369,1399,1367,1395,1365,1364],
[1466,1468,1465,1392,1391,1347,1376,1346,1374,1344,1372,1342,1370,1340,1368,1338,1366,1336,1363,1132],
[1153,1467,1438,1437,1362,1361,1322,1345,1321,1343,1319,1341,1317,1339,1315,1337,1313,1335,1311,1310],
[1462,1464,1461,1390,1389,1334,1333,1295,1320,1294,1318,1292,1316,1290,1314,1288,1312,1286,1309,1130],
[1151,1463,1436,1435,1360,1359,1308,1307,1274,1293,1273,1291,1271,1289,1269,1287,1267,1285,1265,1264],
[1458,1460,1457,1388,1387,1332,1331,1284,1283,1251,1272,1250,1270,1248,1268,1246,1266,1244,1263,1128],
[1149,1459,1434,1433,1358,1357,1306,1305,1262,1261,1234,1249,1233,1247,1231,1245,1229,1243,1227,1226],
[1454,1456,1453,1386,1385,1330,1329,1282,1281,1242,1241,1215,1232,1214,1230,1212,1228,1210,1225,1126],
[1147,1455,1432,1431,1356,1355,1304,1303,1260,1259,1224,1223,1202,1213,1201,1211,1199,1209,1197,1196],
[1450,1452,1449,1384,1383,1328,1327,1280,1279,1240,1239,1208,1207,1187,1200,1186,1198,1184,1195,1124],
[1145,1451,1430,1429,1354,1353,1302,1301,1258,1257,1222,1221,1194,1193,1178,1185,1177,1183,1175,1174],
[1446,1448,1445,1382,1381,1326,1325,1278,1277,1238,1237,1206,1205,1182,1181,1167,1176,1166,1173,1122],
[1143,1447,1428,1427,1352,1351,1300,1299,1256,1255,1220,1219,1192,1191,1172,1171,1162,1165,1161,1160],
[1442,1444,1441,1380,1379,1324,1323,1276,1275,1236,1235,1204,1203,1180,1179,1164,1163,1157,1475,1120],
[1141,1443,1426,1424,1350,1348,1298,1296,1254,1252,1218,1216,1190,1188,1170,1168,1159,1476,1478,1474],
[1140,1443,1425,1134,1349,1133,1297,1131,1253,1129,1217,1127,1189,1125,1169,1123,1158,1121,1477,1119]]

ROW = 18
COL = 20

A_PERC = .1
B_PERC = .9

def makeArray(a, b):
    total = ROW * COL
    tempList = [a] * int(total * A_PERC) + [b] * int(total * B_PERC)
    shuffle(tempList)
    return [tempList[COL*i:COL*i+COL] for i in range(ROW)]

def Surface():
    arrayA=makeArray(1,0)
    for i in range(len(arrayA)):
        for j in range(len(arrayA[i])):
            if arrayA[i][j] == 1:
                print arrayB[i][j]

for k in range(2):
    print '*ELSET, elset=_Surf-'+str(k+1)+'_SNEG, internal, instance=whole-1'
    Surface()
    print '*Surface, type=ELEMENT, name=Surf-'+str(k+1)
    print '_Surf-'+str(k+1)+'_SNEG, SNEG'

经过这里几位热心的朋友指点,写了一个这样的程序。这个程序目的是在18×20的矩阵里随机生成10%的1和90%的0(矩阵命名arrayA),然后当矩阵arrayA的元素为1的时候打印arrayB中相对应的元素。这样做的目的是为了后面好将遗传算法写进去。但是要用到每次随机生成arrayA后arrayA的值,就是那个矩阵,如果循环100次应该有100个arrayA。现在不懂应该如何把每次arrayA的值表示出来,请大家指点一下~因为刚开始学编程,问题可能挺初级的~~表bs俺~~hoho
谢谢
把i,j打印出来不行吗?就是坐标