多层列表访问
牛牛的矩阵相加
https://www.nowcoder.com/practice/730b90507602412fac90a3f106bfa0cd
list1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] n = int(input()) for i in list1: for j in range(len(i)): i[j] = n * i[j] print(list1)
牛牛的矩阵相加
https://www.nowcoder.com/practice/730b90507602412fac90a3f106bfa0cd
list1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] n = int(input()) for i in list1: for j in range(len(i)): i[j] = n * i[j] print(list1)
相关推荐