Pythonで私は書くことができます
def myMethod():
#some work to find the row and col
return (row, col)
row, col = myMethod()
mylist[row][col] # do work on this element
しかし、C#では、自分が書いていることに気づきます
int[] MyMethod()
{
// some work to find row and col
return new int[] { row, col }
}
int[] coords = MyMethod();
mylist[coords[0]][coords[1]] //do work on this element
Pythonic の方法は、明らかにはるかにクリーンです。C#でこれを行う方法はありますか?