aim:Write a program which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i*j.
Note: i=0,1…, X-1; j=0,1,¡Y-1.
Suppose the following inputs are given to the program:
Then, the output of the program should be:
[[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]]
l=[""] r=input("enter the no. of rows") c=input("enter the no. of coloumns") x=int(r) y=int(c) for i in range(0,x): for j in range(0,y): l[i][j]=i*j print(l)
pls help me out… there is an error at line 8
TypeError: ‘str’ object does not support item assignment