We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
# My solution is to create a list of integers out of each line of input, make a list out of their product and finally print the elements of that list separated by a single space.fromitertoolsimportproductA=input().split()A=[int(x)forxinA]B=input().split()B=[int(x)forxinB]C=list(product(A,B))forxinC:print(x,end=" ")
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
itertools.product()
You are viewing a single comment's thread. Return to all comments →