1.代码
代码如下:
import random
row = int(input('请输入矩阵的行数:'))
column = int(input('请输入矩阵的列数:'))
for i in range(row + 1):
for j in range(column + 1):
print(random.randint(0,100), end=' ')
print(random.randint(0,100))
2.运行结果
D:\Python代码\Scripts\python.exe C:/Users/Lenovo/PycharmProjects/pythonFirstStart/实验二/demo6.py
请输入矩阵的行数:3
请输入矩阵的列数:4
77 89 47 40 50 83
68 94 1 79 45 71
79 7 43 59 59 91
50 27 47 10 100 87
Process finished with exit code 0