Tasks: Fill the elements of the matrix randomly with integers. Print the elements of the matrix. Print the number of columns whose sum of elements is the largest
In python recently, and the language is not very like but practical need to pass.
import random def creatArray(): print('Input first index matrix: ') x = int(input()) print('Input second index matrix: ') y = int(input()) array = ([0]*x)*y for i in range (0,x-1): for j in range (0, y-1): array[i][j] = random.randint(0,100) return array print(creatArray()) this way I wanted to fill the array, but gives an error on line 14 and 11. 'TypeError: 'int' object does not support item assignment
Please explain what the problem is and help with the solution with 3 tasks (print the number of columns ...)