Contact: aviboots(AT)netvision.net.il
40,769 questions
53,151 answers
573 users
lst1 = [5, 7, 8, 1, 0] lst2 = [8, 9] lst3 = [x * y for x in lst1 for y in lst2] print(lst3) ''' run: [40, 45, 56, 63, 64, 72, 8, 9, 0, 0] '''
lst1 = [5, 7, 8, 1, 0] lst2 = [8, 9] lst3 = [] for x in lst1: for y in lst2: lst3.append(x * y) print(lst3) ''' run: [40, 45, 56, 63, 64, 72, 8, 9, 0, 0] '''