使用random模块和numpy库生成一个3行4列的多维数组,数组中的每个元素为1~100之间的随机整数,然后求该数组所有元素的平均值。 import numpy as np a=np.random.randint(1,100,(3,4)) print(np.mean(a)