import random
z = 4
x = random.sample(range(50), z)
y = random.sample(range(50), z)
for i in x:
for u in y:
print(i*u)
14
259
343
42
68
1258
1666
204
74
1369
1813
222
84
1554
2058
252
[1, 2, 3, 4]
[1, 2, 3, 4]
4 8 12 16
3 6 9 12
2 4 6 8
1 2 3 4
for i in x:
print(*[i*u for u in y])