使用numpy库的random模块中的randint()方法生成随机数组,并且可以通过参数size来指定数组的大小。from numpy import randomx=random.randint(100, size=(5))print(x)执行结果:[73 68 52 66 35]