我读到了 var rowSize = 100;
var colSize = 100;
var arr = new int[rowSize, colSize];
var r = new Random();
for (int i = 0; i < rowSize; i++)
for (int j = 0; j < colSize; j++)
arr[i, j] = r.Next(20);
for (var subcol = 0; subcol < colSize / 10; subcol++)
{
for (var subrow = 0; subrow < colSize/10; subrow++)
{
var startX = subcol*10;
var startY = subrow*10;
var avg = 0;
for (var x=0; x<10; x++)
for (var y = 0; y < 10; y++)
avg += arr[startX + x, startY + y];
avg /= 10*10;
Console.WriteLine(avg);
}
}
spawn ssh -t {*}$ssh_opts $user@$ip bash $script {*}$argv
我每次都会输出python set
或x = set(["a","b","c","d"])
y = set(["c","d"])
print( x.intersection(y) )
。
虽然它是正确的,但我对{'d', 'c'}
解释器如何阅读集?
答案 0 :(得分:1)
这种情况正在发生,因为set
不像list
那样维护订单。在这里查看此链接,以获得对不同Python结构的详细描述以及何时使用它们:https://stackoverflow.com/a/3489100/1199721