展开全部
#coding=utf-8
'''
Created on 2014-3-21
@author: Neo
'''
def PrintList(array):#输出数组
for i in range(array.__len__()):
print array[i]
def SetList(array):#给数组赋值2113
row = 11
col = 11
for i in range(array.__len__()):
for j in range(array[i].__len__()):
array[i][j] = row
row += 10
col += 1
row = col
print "赋值后5261的二维数组:"
PrintList(array)
return array
def InitList(x, y):
#初始化一个二4102维数组
array = [([0] * y) for i in range(x)]
return array
def GetListByCoord(array, radius, x, y):
#根据半径来确定数组的行数和列1653数
row_col = 2 * radius + 1
#初始化结果数组
result = InitList(row_col, row_col)
#获取传入的array的行数和列数
arrayRow, arrayCol = len(array), len(array[0])
#坐标x、y的值即为结果数组