Find the Product
Problem to find the product of the numbers.
Example-1:
Input : n = "123" m = "456" Output : 14 15 16 24 25 26 34 35 36
Example-2:
Input : n = "13" m = "57" Output : 15 17 35 37
Solution
from itertools import product n = "123" m = "456" d = list(product(n,m)) for i in range(len(d)): print("".join(d[i]),end=" ")
Output
14 15 16 24 25 26 34 35 36