【发布时间】:2019-06-24 16:25:06
【问题描述】:
我想将结果存储到一个 4*9 的矩阵中。我已经发布了我的代码,并且我正在使用嵌套的 for 循环。
我在如何存储结果时遇到了困难。
for d in range(4):
for l in range(9):
a=Swaps(n,d)
k=Permute1(a,v,n)
d = {x[-1]: x[:-1] for x in k}
y= Permute2(a,v1,n)
d1 = {x[-1]: x[:-1] for x in y}
n=Bidirectional_Search(d,d1) #where n is a string
任何帮助将不胜感激
【问题讨论】:
-
此链接可能对您有所帮助:tutorialspoint.com/python/python_2darray.htm
-
您好,感谢您的链接。你能指定我如何存储字符串值吗?
标签: python for-loop matrix multidimensional-array