- Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathq7.py
21 lines (12 loc) · 535 Bytes
/
q7.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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: 3,5
# Then, the output of the program should be:
# [[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]]
x,y=map(int,input().split(','))
lst= []
foriinrange(x):
tmp= []
forjinrange(y):
tmp.append(i*j)
lst.append(tmp)
print(lst)